ERNIE
ERNIE copied to clipboard
利用docker安裝paddle環境後跑bash script/pretrain.sh報錯
您好,第一次問問題,請大家多多指教;我運行bash script/pretrain.sh報錯,具體錯誤訊息如下:
Traceback (most recent call last):
File "./train.py", line 357, in <module>
train(args)
File "./train.py", line 173, in train
pyreader_name='train_reader', ernie_config=ernie_config)
File "./train.py", line 66, in create_model
mask_label, mask_pos, labels)
File "/paddle/pytorch/pytorch-pretrained-BERT-master/LARK/ERNIE/model/ernie.py", line 168, in get_pretraining_output
mask_feat = fluid.layers.gather(input=reshaped_emb_out, index=mask_pos)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/layers/nn.py", line 5751, in gather
outputs={"Out": out})
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/layer_helper.py", line 50, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 1207, in append_op
op = Operator(block=self, desc=op_desc, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 656, in __init__
self.desc.infer_shape(self.block.desc)
paddle.fluid.core.EnforceNotMet: at [/paddle/paddle/fluid/operators/gather_op.cc:34]
PaddlePaddle Call Stacks:
0 0x7fefc69a6d06p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 486
1 0x7fefc6bbd335p paddle::operators::GatherOp::InferShape(paddle::framework::InferShapeContext*) const + 1365
2 0x7fefc6a5ce56p paddle::framework::OpDesc::InferShape(paddle::framework::BlockDesc const&) const + 886
3 0x7fefc6a09145p void pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<void, paddle::framework::OpDesc, paddle::framework::BlockDesc const&, pybind11::name, pybind11::is_method, pybind11::sibling>(void (paddle::framework::OpDesc::*)(paddle::framework::BlockDesc const&) const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(paddle::framework::OpDesc const*, paddle::framework::BlockDesc const&)#1}, void, paddle::framework::OpDesc const*, paddle::framework::BlockDesc const&, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<void, paddle::framework::OpDesc, paddle::framework::BlockDesc const&, pybind11::name, pybind11::is_method, pybind11::sibling>(void (paddle::framework::OpDesc::*)(paddle::framework::BlockDesc const&) const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(paddle::framework::OpDesc const*, paddle::framework::BlockDesc const&)#1}&&, void (*)(paddle::framework::OpDesc const*, paddle::framework::BlockDesc const&), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call) + 213
安裝環境如下:
docker安裝GPU版本的PaddlePaddle,cuda=9.0,cudnn=7,Paddle:1.1.0(後來升級為Paddle:1.3.1.post97)
想問看看如何解決?謝謝
@karta282950 应该是paddle版本太低导致的,gather op在>=1.3.1的版本上应该没有问题
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen it. Thank you for your contributions.