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

Issue with ipython_demo aswell as test_tf #13

Open
jj05y opened this issue Oct 25, 2016 · 2 comments
Open

Issue with ipython_demo aswell as test_tf #13

jj05y opened this issue Oct 25, 2016 · 2 comments

Comments

@jj05y
Copy link

jj05y commented Oct 25, 2016

Having issues getting this implementation running. How downloaded the pretrained model and the tensorflow vgg net, the ixtoword dict, and given correct paths.

When attempting to run the Ipython demo aswell as the test_ft() in model I get the below error?

Anyone else encounter this or have a solution?
Thanks,
Joe

ValueError Traceback (most recent call last)
in ()
31
32
---> 33 fc7_tf, generated_words_tf = caption_generator.build_generator(maxlen=maxlength)
34
35 saver = tf.train.Saver()

/home/joe/edsproject/show_and_tell.tensorflow/model.pyc in build_generator(self, maxlen)
91 image_emb = tf.matmul(image, self.encode_img_W) + self.encode_img_b
92
---> 93 state = tf.zeros([1, self.lstm.state_size])
94 #last_word = image_emb # 첫 단어 대신 이미지
95 generated_words = []

/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.pyc in zeros(shape, dtype, name)
1182 output = constant(zero, shape=shape, dtype=dtype, name=name)
1183 except (TypeError, ValueError):
-> 1184 shape = ops.convert_to_tensor(shape, dtype=dtypes.int32, name="shape")
1185 output = fill(shape, constant(zero, dtype=dtype), name=name)
1186 assert output.dtype.base_dtype == dtype

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.pyc in convert_to_tensor(value, dtype, name, as_ref, preferred_dtype)
655
656 if ret is None:
--> 657 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
658
659 if ret is NotImplemented:

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.pyc in _constant_tensor_conversion_function(v, dtype, name, as_ref)
178 as_ref=False):
179 _ = as_ref
--> 180 return constant(v, dtype=dtype, name=name)
181
182

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.pyc in constant(value, dtype, shape, name)
161 tensor_value = attr_value_pb2.AttrValue()
162 tensor_value.tensor.CopyFrom(
--> 163 tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
164 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype)
165 const_tensor = g.create_op(

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.pyc in make_tensor_proto(values, dtype, shape)
352 else:
353 _AssertCompatible(values, dtype)
--> 354 nparray = np.array(values, dtype=np_dt)
355 # check to them.
356 # We need to pass in quantized values as tuples, so don't apply the shape

ValueError: setting an array element with a sequence.

@AvaisP
Copy link

AvaisP commented Mar 7, 2017

Any updates on this?

@AvaisP
Copy link

AvaisP commented Mar 8, 2017

For anyone facing the same issue in the future, use tensorflow 0.8.0 and protobuf 3.0.0

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

2 participants