In the script 'ntm_cell.py' there is a function named 'build_memory'. It returns a memory matrix M. When I try to print the contents of memory matrix M
it shows:
print (M)
Tensor("NTM_1/memory/Print:0", shape=(128, 20), dtype=float32, device=/device:CPU:0)
when I try to print the contents of this tensor using
print (M.eval())
an error occurs
How can i see what does memory contain?
Traceback (most recent call last):
File "my_main.py", line 72, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "my_main.py", line 52, in main
cell, ntm = create_ntm(FLAGS, sess)
File "my_main.py", line 36, in create_ntm
test_max_length=FLAGS.test_max_length, **ntm_args) # call NTM class constructor in ntm.py
File "/home/user/Documents/deep_learning_frameworks/NTM-tensorflow-master/ntm.py", line 84, in init
self.build_model(forward_only)
File "/home/user/Documents/deep_learning_frameworks/NTM-tensorflow-master/ntm.py", line 92, in build_model
_, prev_state = self.cell(self.start_symbol, state=None)
File "/home/user/Documents/deep_learning_frameworks/NTM-tensorflow-master/ntm_cell.py", line 83, in call
last_output)
File "/home/user/Documents/deep_learning_frameworks/NTM-tensorflow-master/ntm_cell.py", line 295, in build_memory
print (M.eval())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 559, in eval
return _eval_using_default_session(self, feed_dict, self.graph, session)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3761, in _eval_using_default_session
return session.run(tensors, feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 717, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 915, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 985, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors.InvalidArgumentError: You must feed a value for placeholder tensor 'start_symbol' with dtype float and shape [10]
[[Node: start_symbol = Placeholderdtype=DT_FLOAT, shape=[10], _device="/job:localhost/replica:0/task:0/cpu:0"]]
Caused by op u'start_symbol', defined at:
File "my_main.py", line 72, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "my_main.py", line 52, in main
cell, ntm = create_ntm(FLAGS, sess)
File "my_main.py", line 36, in create_ntm
test_max_length=FLAGS.test_max_length, **ntm_args) # call NTM class constructor in ntm.py
File "/home/user/Documents/deep_learning_frameworks/NTM-tensorflow-master/ntm.py", line 67, in init
name='start_symbol')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1332, in placeholder
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 1748, in _placeholder
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2380, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1298, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'start_symbol' with dtype float and shape [10]
[[Node: start_symbol = Placeholderdtype=DT_FLOAT, shape=[10], _device="/job:localhost/replica:0/task:0/cpu:0"]]