show_and_tell.tensorflow icon indicating copy to clipboard operation
show_and_tell.tensorflow copied to clipboard

error when I run the test_tf

Open exactreal opened this issue 8 years ago • 5 comments

ImportError: This module is deprecated. Use tf.nn.rnn_cell instead.

exactreal avatar Aug 04 '16 04:08 exactreal

Use following self.lstm = tf.nn.rnn_cell.BasicLSTMCell(dim_hidden)

This will give warning but code will run

dipanjan06 avatar Aug 05 '16 09:08 dipanjan06

I am having an error as well, but is this:

File "caption.py", line 1, in from model import * File "/home/marco/SceneDescription/works.poorly_show_and_tell.tensorflow/model.py", line 317, in test_tf("/home/marco/Pelotas/ArtigoPelotas/catedral.jpeg") File "/home/marco/SceneDescription/works.poorly_show_and_tell.tensorflow/model.py", line 303, in test_tf fc7_tf, generated_words = caption_generator.build_generator(maxlen=maxlen) File "/home/marco/SceneDescription/works.poorly_show_and_tell.tensorflow/model.py", line 93, in build_generator state = tf.zeros([1, self.lstm.state_size]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1184, in zeros shape = ops.convert_to_tensor(shape, dtype=dtypes.int32, name="shape") File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 657, in convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 180, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 163, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 354, in make_tensor_proto nparray = np.array(values, dtype=np_dt) ValueError: setting an array element with a sequence.

Could someone help me? I remember i have ran this code some days ago, but now I just cannot make it happens.

mabirck avatar Oct 24 '16 12:10 mabirck

@mabirck Did you get the solution? I have the exactly same error with you.

BeSlower avatar Dec 13 '16 21:12 BeSlower

Me too

nqkhai1706 avatar Jan 16 '17 11:01 nqkhai1706

I get the error when I run test_tf(). Is it caused by the version of tf?

File "zzq_test.py", line 387, in test_tf fc7 = sess.run(graph.get_tensor_by_name("import/fc7_relu:0"), feed_dict={images:image_val}) File "/home/zzq/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2561, in get_tensor_by_name return self.as_graph_element(name, allow_tensor=True, allow_operation=False) File "/home/zzq/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2412, in as_graph_element return self._as_graph_element_locked(obj, allow_tensor, allow_operation) File "/home/zzq/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2454, in _as_graph_element_locked "graph." % (repr(name), repr(op_name))) KeyError: "The name 'import/fc7_relu:0' refers to a Tensor which does not exist. The operation, 'import/fc7_relu', does not exist in the graph."

zhengziqiang avatar Mar 10 '17 12:03 zhengziqiang