gru4rectensorflow's People
Forkers
privatethinkgru4rectensorflow's Issues
UnimplementedError (see above for traceback): TensorArray has size zero, but element shape <unknown> is not fully defined.?
hi,
When I run this code with tensorflow-gpu=1.4 that I get a error ,this error as follows:
Traceback (most recent call last):
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1039, in _do_call
return fn(*args)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1021, in _run_fn
status, run_metadata)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/contextlib.py", line 66, in exit
next(self.gen)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.UnimplementedError: TensorArray has size zero, but element shape [?,10] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays.
[[Node: rnn/TensorArrayStack/TensorArrayGatherV3 = TensorArrayGatherV3[_class=["loc:@rnn/TensorArray"], dtype=DT_FLOAT, element_shape=[?,10], _device="/job:localhost/replica:0/task:0/gpu:0"](rnn/TensorArray, rnn/TensorArrayStack/range, rnn/while/Exit_1)]]
[[Node: gradients/embedding_lookup_grad/Reshape/_29 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_540_gradients/embedding_lookup_grad/Reshape", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "NewGRU4Sec.py", line 113, in
_, output_rnn_value, loss_value, top20_value = sess.run([ optimizer,outputs_rnn, loss, top20], feed_dict = {x: curr_input, y: curr_output, x_length: len(curr_input[0])})
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnimplementedError: TensorArray has size zero, but element shape [?,10] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays.
[[Node: rnn/TensorArrayStack/TensorArrayGatherV3 = TensorArrayGatherV3[_class=["loc:@rnn/TensorArray"], dtype=DT_FLOAT, element_shape=[?,10], _device="/job:localhost/replica:0/task:0/gpu:0"](rnn/TensorArray, rnn/TensorArrayStack/range, rnn/while/Exit_1)]]
[[Node: gradients/embedding_lookup_grad/Reshape/_29 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_540_gradients/embedding_lookup_grad/Reshape", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]
Caused by op 'rnn/TensorArrayStack/TensorArrayGatherV3', defined at:
File "NewGRU4Sec.py", line 80, in
outputs_rnn, state = tf.nn.dynamic_rnn(cell, inputs=inputs, dtype=tf.float32)#, sequence_length = x_length)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/rnn.py", line 553, in dynamic_rnn
dtype=dtype)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/rnn.py", line 723, in _dynamic_rnn_loop
final_outputs = tuple(ta.stack() for ta in output_final_ta)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/rnn.py", line 723, in
final_outputs = tuple(ta.stack() for ta in output_final_ta)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/tensor_array_ops.py", line 301, in stack
return self.gather(math_ops.range(0, self.size()), name=name)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/tensor_array_ops.py", line 328, in gather
element_shape=element_shape)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 2244, in _tensor_array_gather_v3
element_shape=element_shape, name=name)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/wsy/anaconda2/envs/zcdpy35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()
UnimplementedError (see above for traceback): TensorArray has size zero, but element shape [?,10] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays.
[[Node: rnn/TensorArrayStack/TensorArrayGatherV3 = TensorArrayGatherV3[_class=["loc:@rnn/TensorArray"], dtype=DT_FLOAT, element_shape=[?,10], _device="/job:localhost/replica:0/task:0/gpu:0"](rnn/TensorArray, rnn/TensorArrayStack/range, rnn/while/Exit_1)]]
[[Node: gradients/embedding_lookup_grad/Reshape/_29 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_540_gradients/embedding_lookup_grad/Reshape", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]
so I want to get your help. What's your running environment?
Thank you, Look forward to receiving your reply
Maybe a bug in data preprocessing?
GRU4RecTensorflow/process_data.py
Line 82 in 3fe6a53
You should check this line, because the length of new_list_items
popped from data
may be less 2.
how to handle different session?
hi,
Thanks for your wonderful work. I have some confusion. In this code, you did not reset rnn cell states for different session? whether this will affect the final outcome or not?
Looking forward to your reply!
shi
recall for hidden size 100 is 0.33?
recall for hidden size 100 is 0.33?
I reimplement a similar version like you.
I also replace the original training process of Hidasi by dynamic rnn
my recall is 0.41
is it strange? the orginal recall is 0.63
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.