Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

"Ambiguous dimension: 24.5" in decoder call #5

Open
GregStacey opened this issue Aug 22, 2018 · 5 comments
Open

"Ambiguous dimension: 24.5" in decoder call #5

GregStacey opened this issue Aug 22, 2018 · 5 comments

Comments

@GregStacey
Copy link

I'm trying to run the VAE example by copying and pasting the code into a .py file. I'm getting the error below when I try to run it. Unfortunately I'm a python newbie and don't know what's going on. Any help is appreciated!

In [64]: dec = decoder(sampled, keep_prob)
Traceback (most recent call last):

File "", line 1, in
dec = decoder(sampled, keep_prob)

File "", line 60, in decoder
x = tf.layers.dense(sampled_z, units=inputs_decoder, activation=lrelu)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/core.py", line 215, in dense
return layer.apply(inputs)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 492, in apply
return self.call(inputs, *args, **kwargs)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 434, in call
self.build(input_shapes[0])

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/core.py", line 118, in build
trainable=True)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 374, in add_variable
trainable=trainable and self.trainable)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
use_resource=use_resource, custom_getter=custom_getter)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
use_resource=use_resource, custom_getter=custom_getter)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 367, in get_variable
validate_shape=validate_shape, use_resource=use_resource)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
use_resource=use_resource)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 653, in _get_single_variable
shape = tensor_shape.as_shape(shape)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 798, in as_shape
return TensorShape(shape)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 434, in init
self._dims = [as_dimension(d) for d in dims_iter]

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 434, in
self._dims = [as_dimension(d) for d in dims_iter]

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 376, in as_dimension
return Dimension(value)

File "/Users/Mercy/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 35, in init
raise ValueError("Ambiguous dimension: %s" % value)

ValueError: Ambiguous dimension: 24.5

@paul-cb
Copy link

paul-cb commented Sep 28, 2018

I'm getting the same error. Has this been resolved?

@GregStacey
Copy link
Author

Yes, it was resolved for me. I'm halfway sure the issue was due to certain versions of python/tensorflow clashing, but unfortunately I can't remember exactly what I did to fix it. I believe the answer I followed was in a github issue thread. Let me know if you don't resolve it, and I'll try and find it.

@paul-cb
Copy link

paul-cb commented Oct 1, 2018

I see! I still have this issue, it'd be super helpful if you could. Thanks

@dalek7
Copy link

dalek7 commented Feb 25, 2019

I guess this issue comes from the dimension, which should be integer.
replace

inputs_decoder = 49 * dec_in_channels / 2

with

inputs_decoder = 49 * dec_in_channels // 2

Hope this helps !

@allaabdella2
Copy link

I opened a new issue. Do you mind if you look at it? @dalek7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants