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

error when I run the test_tf #7

Open
exactreal opened this issue Aug 4, 2016 · 5 comments
Open

error when I run the test_tf #7

exactreal opened this issue Aug 4, 2016 · 5 comments

Comments

@exactreal
Copy link

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

@dipanjan06
Copy link

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

This will give warning but code will run

@mabirck
Copy link

mabirck commented Oct 24, 2016

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.

@BeSlower
Copy link

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

@nqkhai1706
Copy link

Me too

@zhengziqiang
Copy link

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."

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

6 participants