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 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: