Skip to content
New issue

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

ValueError: prefix tensor must be either a scalar or vector, but saw tensor: Tensor("Placeholder:0", dtype=int32) #2

Open
SeekPoint opened this issue Nov 14, 2018 · 0 comments

Comments

@SeekPoint
Copy link

ub16c9@ub16c9-gpu:/ub16_prj/KeyPhrase-Extraction$ python main.py
len(train_data) 70484
len(valid_data) 7832
len(test_data) 33541
len(vocab) 240058
Train started!
2018-11-14 09:30:16.762768: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-11-14 09:30:16.917598: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-11-14 09:30:16.918011: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties:
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.6575
pciBusID: 0000:01:00.0
totalMemory: 10.92GiB freeMemory: 10.42GiB
2018-11-14 09:30:16.918040: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-11-14 09:30:17.675964: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10081 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
Traceback (most recent call last):
File "main.py", line 186, in
main()
File "main.py", line 73, in main
model_cell='lstm'
File "/home/ub16c9/ub16_prj/KeyPhrase-Extraction/models/model.py", line 62, in init
self.init_state=single_cell1.zero_state(self.batch_size,dtype=tf.float32)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1004, in zero_state
return self._cell.zero_state(batch_size, dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 252, in zero_state
output = _zero_state_tensors(state_size, batch_size, dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 134, in _zero_state_tensors
return nest.map_structure(get_state_shape, state_size)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/nest.py", line 459, in map_structure
structure[0], [func(*x) for x in entries])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 128, in get_state_shape
c = _concat(batch_size, s)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 93, in _concat
"but saw tensor: %s" % p)
ValueError: prefix tensor must be either a scalar or vector, but saw tensor: Tensor("Placeholder:0", dtype=int32)
ub16c9@ub16c9-gpu:
/ub16_prj/KeyPhrase-Extraction$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant