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

From merging shape 0 with other shapes. for 'concat/concat_dim' (op: 'Pack') with input shapes: [64,100], [64,256] #61

Open
krnk111 opened this issue Jan 5, 2020 · 2 comments

Comments

@krnk111
Copy link

krnk111 commented Jan 5, 2020

/home/naveen/anaconda3/lib/python3.7/site-packages/dask/config.py:168: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
data = yaml.load(f.read()) or {}
WARNING:tensorflow:From /home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
(64, 256)
Traceback (most recent call last):
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1610, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 100 and 256. Shapes are [64,100] and [64,256].
From merging shape 0 with other shapes. for 'concat/concat_dim' (op: 'Pack') with input shapes: [64,100], [64,256].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/naveen/eclipse-workspace/text-to-image-master/train.py", line 238, in
main()
File "/home/naveen/eclipse-workspace/text-to-image-master/train.py", line 76, in main
input_tensors, variables, loss, outputs, checks = gan.build_model()
File "/home/naveen/eclipse-workspace/text-to-image-master/model.py", line 39, in build_model
fake_image = self.generator(t_z, t_real_caption)
File "/home/naveen/eclipse-workspace/text-to-image-master/model.py", line 141, in generator
z_concat = tf.concat(1, [t_z, reduced_text_embedding])
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 1427, in concat
ops.convert_to_tensor(axis, name="concat_dim",dtype=dtypes.int32).get_shape().assert_has_rank(0)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1184, in convert_to_tensor
return convert_to_tensor_v2(value, dtype, preferred_dtype, name)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1242, in convert_to_tensor_v2
as_ref=False)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1296, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 1278, in _autopacking_conversion_function
return _autopacking_helper(v, dtype, name or "packed")
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 1214, in _autopacking_helper
return gen_array_ops.pack(elems_as_tensors, name=scope)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_array_ops.py", line 6304, in pack
"Pack", values=values, axis=axis, name=name)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/op_def_library.py", line 793, in _apply_op_helper
op_def=op_def)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3360, in create_op
attrs, op_def, compute_device)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3429, in _create_op_internal
op_def=op_def)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1773, in init
control_input_ops)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1613, in _create_c_op
raise ValueError(str(e))
ValueError: Dimension 1 in both shapes must be equal, but are 100 and 256. Shapes are [64,100] and [64,256].
From merging shape 0 with other shapes. for 'concat/concat_dim' (op: 'Pack') with input shapes: [64,100], [64,256].

@krnk111
Copy link
Author

krnk111 commented Jan 5, 2020

the above error msg i am getting when I am using default options for train.py.

if I change the "--z_dim" == 256, I am getting the following error,

/home/naveen/anaconda3/lib/python3.7/site-packages/dask/config.py:168: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
data = yaml.load(f.read()) or {}
WARNING:tensorflow:From /home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
(64, 256)
Traceback (most recent call last):
File "/home/naveen/eclipse-workspace/text-to-image-master/train.py", line 238, in
main()
File "/home/naveen/eclipse-workspace/text-to-image-master/train.py", line 76, in main
input_tensors, variables, loss, outputs, checks = gan.build_model()
File "/home/naveen/eclipse-workspace/text-to-image-master/model.py", line 39, in build_model
fake_image = self.generator(t_z, t_real_caption)
File "/home/naveen/eclipse-workspace/text-to-image-master/model.py", line 141, in generator
z_concat = tf.concat(1, [t_z, reduced_text_embedding])
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 1427, in concat
ops.convert_to_tensor(axis, name="concat_dim",dtype=dtypes.int32).get_shape().assert_has_rank(0)
File "/home/naveen/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_shape.py", line 995, in assert_has_rank
raise ValueError("Shape %s must have rank %d" % (self, rank))
ValueError: Shape (2, 64, 256) must have rank 0.

I request your help in this regard....

@jerryzz668
Copy link

I meet the same question, can somebody else fix this question

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