emotion_detection教程中基于 ERNIE 进行 Finetune报错
Created by: ML-ZXF
执行这段代码后报错 前面都按照1.8的教程走下来了 不知道是哪里的问题 请指教
#--init_checkpoint ./pretrain_models/ernie sh run_ernie.sh train
报错内容:
----------- Configuration Arguments ----------- batch_size: 32 data_dir: None dev_set: ./data/dev.tsv do_infer: False do_lower_case: True do_train: True do_val: True epoch: 3 ernie_config_path: ./pretrain_models/ernie//ernie_config.json infer_set: None init_checkpoint: ./pretrain_models/ernie//params label_map_config: None lr: 2e-05 max_seq_len: 64 num_labels: 3 random_seed: 1 save_checkpoint_dir: ./save_models/ernie save_steps: 500 skip_steps: 50 task_name: None test_set: None train_set: ./data/train.tsv use_cuda: True use_paddle_hub: False validation_steps: 50 verbose: True vocab_path: ./pretrain_models/ernie//vocab.txt
attention_probs_dropout_prob: 0.1 hidden_act: relu hidden_dropout_prob: 0.1 hidden_size: 768 initializer_range: 0.02 max_position_embeddings: 513 num_attention_heads: 12 num_hidden_layers: 12 type_vocab_size: 2 vocab_size: 18000
Device count: 1 Num train examples: 9655 Max train steps: 906 Theoretical memory usage in training: 7954.669 - 8333.463 MB W0804 18:40:22.526546 17467 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 75, Driver API Version: 10.2, Runtime API Version: 10.0 W0804 18:40:22.530467 17467 device_context.cc:260] device: 0, cuDNN Version: 7.6. 2020-08-04 18:40:24,913-WARNING: ./pretrain_models/ernie//params.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] 2020-08-04 18:40:24,922-WARNING: variable file [ ./pretrain_models/ernie//params/mask_lm_trans_layer_norm_scale ./pretrain_models/ernie//params/tmp_51 ./pretrain_models/ernie//params/mask_lm_trans_layer_norm_bias ./pretrain_models/ernie//params/next_sent_3cls_fc.w_0 ./pretrain_models/ernie//params/@LR_DECAY_COUNTER@ ./pretrain_models/ernie//params/next_sent_3cls_fc.b_0 ./pretrain_models/ernie//params/mask_lm_trans_fc.w_0 ./pretrain_models/ernie//params/mask_lm_trans_fc.b_0 ./pretrain_models/ernie//params/reduce_mean_0.tmp_0 ./pretrain_models/ernie//params/mask_lm_out_fc.b_0 ] not used /home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/executor.py:1070: UserWarning: The following exception is not an EOF exception. "The following exception is not an EOF exception.") Traceback (most recent call last): File "run_ernie_classifier.py", line 402, in main(args) File "run_ernie_classifier.py", line 326, in main outputs = train_exe.run(program=train_program, fetch_list=fetch_list, return_numpy=False) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1071, in run six.reraise(*sys.exc_info()) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/six.py", line 703, in reraise raise value File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1066, in run return_merged=return_merged) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1154, in _run_impl use_program_cache=use_program_cache) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1229, in _run_program fetch_var_name) paddle.fluid.core_avx.EnforceNotMet:
C++ Call Stacks (More useful to developers):
0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&, char const*, int) 1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) 2 paddle::operators::ReadOp::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 3 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 4 paddle::framework::Executor::RunPartialPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, long, long, bool, bool, bool) 5 paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) 6 paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool, bool)
Python Call Stacks (More useful to users):
File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/framework.py", line 2610, in append_op attrs=kwargs.get("attrs", None)) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/reader.py", line 1079, in _init_non_iterable attrs={'drop_last': self._drop_last}) File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/reader.py", line 977, in init self._init_non_iterable() File "/home/ubuntu/.virtualenvs/zxf_env/lib/python3.6/site-packages/paddle/fluid/reader.py", line 608, in from_generator iterable, return_list, drop_last) File "../shared_modules/models/representation/ernie.py", line 48, in ernie_pyreader use_double_buffer=True) File "run_ernie_classifier.py", line 216, in main pyreader_name='train_reader') File "run_ernie_classifier.py", line 402, in main(args)
Error Message Summary:
InvalidArgumentError: The fed Variable 1 should have dimensions = 3, shape = [-1, 64, 1], but received fed shape [32, 23, 1] [Hint: Expected DimensionIsCompatibleWith(shapes[i], in_dims) == true, but received DimensionIsCompatibleWith(shapes[i], in_dims):0 != true:1.] at (/paddle/paddle/fluid/operators/reader/read_op.cc:137) [operator < read > error]