You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inception_scope.py in the tf version =1.11.0 (python 3.6) works well for me. But when I run it in another machine with tf version=1.8.0 (python 3.5), it reports a ValueError "Cannot iterate over a shape with unknown rank" occurring in the code here:
def _inception_score(self):
....
for o in op.outputs:
shape = o.get_shape()
shape = [s.value for s in shape]. # error raised
I observed that the problem is perhaps caused by various Tensor type of o, which is with both tf.float32 and tf.bool. However, the bool type of o has the shape of [ ], which could not be correctly executed by the iteration s.value for s in shape iteration, therefore a ValueError raising! We could fix it by the following modifications:
def _inception_score(self):`
....
for o in op.outputs:
if o.dtype == tf.bool:
shape = []
else:
shape = [s.value for s in o.shape]
The text was updated successfully, but these errors were encountered:
China-LiuXiaopeng
changed the title
inception score computing: fixed the issue of "Cannot iterate over a shape with unknown rank"
inception_score.py: fixed the issue of ValueError "Cannot iterate over a shape with unknown rank"
Nov 16, 2018
The inception_scope.py in the tf version =1.11.0 (python 3.6) works well for me. But when I run it in another machine with tf version=1.8.0 (python 3.5), it reports a ValueError "Cannot iterate over a shape with unknown rank" occurring in the code here:
I observed that the problem is perhaps caused by various Tensor type of o, which is with both tf.float32 and tf.bool. However, the bool type of o has the shape of [ ], which could not be correctly executed by the iteration
s.value for s in shape iteration
, therefore a ValueError raising! We could fix it by the following modifications:The text was updated successfully, but these errors were encountered: