基于栈式双向LSTM的情感识别 GPU训练报错
Created by: AlucardNosferatu
step: 194, Metrics [array([0.24539784], dtype=float32), array([0.921875], dtype=float32)] step: 195, Metrics [array([0.4097221], dtype=float32), array([0.8], dtype=float32)] /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py:782: UserWarning: The following exception is not an EOF exception. "The following exception is not an EOF exception.") Traceback (most recent call last): File "SA_Test.py", line 252, in main(use_cuda) File "SA_Test.py", line 246, in main infer(use_cuda, params_dirname) File "SA_Test.py", line 234, in infer return_numpy=False) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 783, in run six.reraise(*sys.exc_info()) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/six.py", line 693, in reraise raise value File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 778, in run use_program_cache=use_program_cache) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 831, in _run_impl use_program_cache=use_program_cache) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 902, in _run_program self._feed_data(program, feed, feed_var_name, scope) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 580, in _feed_data check_feed_shape_type(var, cur_feed) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 230, in check_feed_shape_type (var.name, len(var.shape), var.shape, feed_shape)) ValueError: The feeded Variable 'words' should have dimensions = 1, shape = (-1,), but received feeded shape [-1, 1] on each device
用的代码:https://github.com/PaddlePaddle/book/blob/develop/06.understand_sentiment/train_stacked_lstm.py
没有修改任何部分 运行指令:
python SA_Test.py --use_gpu 1