- 标题:reshape op 反向过程中报错: The Tensor in the reshape2_grad Op's Input Variable Out@GRAD(slice_34.tmp_0@GRAD) is not initialized
- 版本、环境信息:
1)cpu版本 1.7.1 Mac OS 10.14,Python3.7.0
2) gpu版本1.6.2.post107, Python2.7.13
- 训练信息
1)gpu 单机单卡、单机多卡都报错
2)cpu单线程、多线程都报错
3)Operator信息
Traceback (most recent call last):
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/tasks/bml_renshou/run_with_json.py", line 114, in
run_trainer(_params)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/tasks/bml_renshou/run_with_json.py", line 97, in run_trainer
trainer.train_and_eval()
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/training/custom_trainer.py", line 105, in train_and_eval
raise e
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/training/custom_trainer.py", line 53, in train_and_eval
self.run(InstanceName.TRAINING, need_fetch=False)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/common/controler.py", line 434, in run
self.train_exe.run(fetch_list=[])
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/parallel_executor.py", line 311, in run
return_numpy=return_numpy)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/executor.py", line 783, in run
six.reraise(*sys.exc_info())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/six.py", line 693, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/executor.py", line 778, in run
use_program_cache=use_program_cache)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/executor.py", line 843, in _run_impl
return_numpy=return_numpy)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/executor.py", line 677, in _run_parallel
tensors = exe.run(fetch_var_names)._move_to_list()
paddle.fluid.core_avx.EnforceNotMet:
C++ Call Stacks (More useful to developers):
0 std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > paddle::platform::GetTraceBackString<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&&&, char const*, int)
1 paddle::framework::OperatorWithKernel::ParseInputDataType(paddle::framework::ExecutionContext const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, paddle::framework::proto::VarType_Type*) const
2 paddle::framework::OperatorWithKernel::IndicateVarDataType(paddle::framework::ExecutionContext const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) const
3 paddle::operators::Reshape2GradOp::GetExpectedKernelType(paddle::framework::ExecutionContext const&) const
4 paddle::framework::OperatorWithKernel::ChooseKernel(paddle::framework::RuntimeContext const&, paddle::framework::Scope const&, paddle::platform::Place const&) const
5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const
6 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const
7 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&)
8 paddle::framework::details::ComputationOpHandle::RunImpl()
9 paddle::framework::details::FastThreadedSSAGraphExecutor::RunOpSync(paddle::framework::details::OpHandleBase*)
10 paddle::framework::details::FastThreadedSSAGraphExecutor::RunOp(paddle::framework::details::OpHandleBase*, std::__1::shared_ptr<paddle::framework::BlockingQueue > const&, unsigned long*)
11 std::__1::__packaged_task_func<std::__1::__bind<paddle::framework::details::FastThreadedSSAGraphExecutor::RunOpAsync(std::__1::unordered_map<paddle::framework::details::OpHandleBase*, std::__1::atomic, std::__1::hashpaddle::framework::details::OpHandleBase*, std::__1::equal_topaddle::framework::details::OpHandleBase*, std::__1::allocator<std::__1::pair<paddle::framework::details::OpHandleBase* const, std::__1::atomic > > >, paddle::framework::details::OpHandleBase, std::__1::shared_ptr<paddle::framework::BlockingQueue > const&)::$_0>, std::__1::allocator<std::__1::__bind<paddle::framework::details::FastThreadedSSAGraphExecutor::RunOpAsync(std::__1::unordered_map<paddle::framework::details::OpHandleBase*, std::__1::atomic, std::__1::hashpaddle::framework::details::OpHandleBase*, std::__1::equal_topaddle::framework::details::OpHandleBase*, std::__1::allocator<std::__1::pair<paddle::framework::details::OpHandleBase* const, std::__1::atomic > > >, paddle::framework::details::OpHandleBase, std::__1::shared_ptr<paddle::framework::BlockingQueue > const&)::$_0> >, void ()>::operator()()
12 std::__1::packaged_task<void ()>::operator()()
13 ThreadPool::ThreadPool(unsigned long)::'lambda'()::operator()() const
14 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, ThreadPool::ThreadPool(unsigned long)::'lambda'()> >(void*, void*)
Python Call Stacks (More useful to users):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2525, in append_op
attrs=kwargs.get("attrs", None))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
return self.main_program.current_block().append_op(args,kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/paddle/fluid/layers/nn.py", line 5676, in reshape
"XShape": x_shape})
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/models/bml_renshou_multi_label.py", line 88, in forward
real_label = fluid.layers.reshape(index_label, shape=[-1, 1], inplace=True)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/common/controler.py", line 355, in init_train_net
self.forward_train_output = self.model_class.forward(fields_dict, phase=InstanceName.TRAINING)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/common/controler.py", line 338, in init_net
self.init_train_net()
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/common/controler.py", line 127, ininit*
self.init_net()
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/textone/training/custom_trainer.py", line 30, ininit
BaseTrainer.init(self, params, data_set_reader, model_class)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/tasks/bml_renshou/run_with_json.py", line 74, in build_trainer
trainer = trainer_class(params=params_dict, data_set_reader=dataset_reader, model_class=model)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/tasks/bml_renshou/run_with_json.py", line 95, in run_trainer
trainer = build_trainer(trainer_params_dict, dataset_reader, model, num_train_examples)
File "/Users/baidu/Desktop/icode_test/baidu/nlp/textone/tasks/bml_renshou/run_with_json.py", line 114, in
run_trainer(_params)
Error Message Summary:
InvalidArgumentError: The Tensor in the reshape2_grad Op's Input Variable Out@GRAD(slice_34.tmp_0@GRAD) is not initialized.
[Hint: Expected t->IsInitialized() == true, but received t->IsInitialized():0 != true:1.] at (/home/teamcity/work/ef54dc8a5b211854/paddle/fluid/framework/operator.cc:1264)
[operator < reshape2_grad > error]
Process finished with exit code 1
1条答案
按热度按时间omhiaaxx1#
`class BmlRenShouMultiLabelClassification(Model):
"""BmlRenShouMultiLabelClassification
"""
`