Dat
Dat

Reputation: 5803

tf.Estimator.train throws as_list() is not defined on an unknown TensorShape

I created a custom input_func and converted a keras model into tf.Estimator for training. However, it keeps throwing me error.

Upvotes: 2

Views: 5243

Answers (1)

slegall56
slegall56

Reputation: 105

I had the same problem. In input_fun, if you look at images in line "return {'input_images': images}, labels", you'll see that your tensor has no shape. You have to call set_shape for each image. Look at https://github.com/tensorflow/models/blob/master/official/resnet/imagenet_main.py, they call vgg_preprocessing.preprocess_image to set the shape

Upvotes: 1

Related Questions