We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traceback (most recent call last): File "/home/ly/src/tl-play/ch5_word2vec.py", line 134, in _, loss_val = sess.run([train_op, cost], feed_dict=feed_dict) File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run run_metadata_ptr) File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1137, in _run feed_dict_tensor, options, run_metadata) File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run options, run_metadata) File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: AttrValue must not have reference type value of float_ref for attr 'tensor_type' ; NodeDef: word2vec_layer/embeddings/Adagrad/_61 = _Recv[_start_time=0, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_480_word2vec_layer/embeddings/Adagrad", tensor_type=DT_FLOAT_REF, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^Adagrad/learning_rate, ^Adagrad/update_word2vec_layer/embeddings/UnsortedSegmentSum, ^Adagrad/update_word2vec_layer/embeddings/Unique); Op<name=_Recv; signature= -> tensor:tensor_type; attr=tensor_type:type; attr=tensor_name:string; attr=send_device:string; attr=send_device_incarnation:int; attr=recv_device:string; attr=client_terminated:bool,default=false; is_stateful=true> [[Node: word2vec_layer/embeddings/Adagrad/_61 = _Recv[_start_time=0, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_480_word2vec_layer/embeddings/Adagrad", tensor_type=DT_FLOAT_REF, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^Adagrad/learning_rate, ^Adagrad/update_word2vec_layer/embeddings/UnsortedSegmentSum, ^Adagrad/update_word2vec_layer/embeddings/Unique)]]
如果换成AdamOptimizer,就没有这个错误. 代码在https://gist.github.com/arisliang/a197b17b6330a86a56e500907dcd07c5 可能是AdagradOptimizer的问题.
The text was updated successfully, but these errors were encountered:
用网上的代码跑,没出现错误吧?
Sorry, something went wrong.
网上的代码(https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_word2vec_basic.py) 貌似没有这个错误。不过网上代码有model 1,2,3,4,跟书中的代码不完全一致。
建议把书中使用的代码放在github上,可以和自己打的代码有直接对照。官方的代码往往有很大区别,不容易比较。
No branches or pull requests
如果换成AdamOptimizer,就没有这个错误.
代码在https://gist.github.com/arisliang/a197b17b6330a86a56e500907dcd07c5
可能是AdagradOptimizer的问题.
The text was updated successfully, but these errors were encountered: