simple-keras-rest-api icon indicating copy to clipboard operation
simple-keras-rest-api copied to clipboard

Solves ValueError (using same graph)

Open krshrimali opened this issue 6 years ago • 1 comments

Solves: ValueError problem because of not saving the graph just after loading the pre-trained weights of ResNet50.

Error: (at execution of model.predict(image))

ValueError: Tensor Tensor("fc1000/Softmax:0", shape=(?, 1000), dtype=float32) is not an element of this graph.

System details: Ubuntu 18.04 Keras Version: 2.1.6 Tensorflow Version: 1.8.0 Python Version: Python 3.6.5

Reference: https://github.com/tensorflow/tensorflow/issues/14356#issuecomment-385962623

krshrimali avatar Aug 18 '18 18:08 krshrimali

Your PR will fail if the user is using a non-TF backend (such as Theano, CNTK, mxnet, etc.). If you're making TF specific checks you'll want to check and see if the user is actually using TF.

jrosebr1 avatar Sep 24 '18 08:09 jrosebr1