Open 17385 opened 4 years ago
您好, 求问一下详细的报错,我这边运行是没有错误的。 谢谢~
详细的报错: raceback (most recent call last): File "C:\Users\17385\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1334, in _do_call return fn(*args) File "C:\Users\17385\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "C:\Users\17385\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1407, in _call_tf_session run run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[22,26,0] = 292 is not in [0, 292) [[{{node embedding_lookup_6}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 302, in
Caused by op 'embedding_lookup_6', defined at:
File "run.py", line 302, in
InvalidArgumentError (see above for traceback): indices[22,26,0] = 292 is not in [0, 292) [[node embedding_lookup_6 (defined at E:\TreeGen-master\code_generate_model.py:677) ]]
但是我修改run.py中的Tree_vocabu_size = len(tree_vocabulary)+1 #len(tree_vocabulary)
后,训练可以继续下去了,这样可以吗?
谢谢您回答我的问题。
如果训练可以继续,那便是可以的~ 我这边再查一下bug,谢谢您的关注~ Zeyu
请问关于这个问题有什么进展吗?我也遇到了同样的问题,我觉得是tree的vocabulary有292个,所以embedding取值应该是0-291,但是不知什么原因,代码里某处要给某个矩阵位置赋一个为292的值,所以出现了这个问题。
我的环境是python3.6, tensorflow1.12.0, ubuntu20.04, NLTK3.2.1
您好,我找到问题了,reslove_data.py
的第87行,tree_vocabulary["End"] = len(tree_vocabulary)
导致End
的值为tree vocabulary的长度(292),超出了取值范围,我注释掉这一行就不会报这个错了。请问这行有什么特殊的用途吗?可以删掉吗?
我在命令行输入:python run.py HS-B 运行您的代码的时出现错误: InvalidArgumentError (see above for traceback): indices[29,26,0] = 292 is not in [0, 292) [[node embedding_lookup_6 (defined at E:\TreeGen-master\code_generate_model.py:677) ]]
code_generate_model.py中
new_m = common_layers.cast_like(new_m, var)
报错 Unresolved reference 'common_layers'(依赖包已经全部装好,我的使用的系统环境是win10。) 想请问您如何解决这个问题,并完整运行整个项目。