Try first:
import tensorflow as tf
graph = tf.get_default_graph()
Then, when you need to use predict:
with graph.as_default():
y = model.predict(X)
More Related Contents:
- Tensorflow One Hot Encoder?
- What are logits? What is the difference between softmax and softmax_cross_entropy_with_logits?
- Keras Dense layer’s input is not flattened
- Make a custom loss function in keras
- How to choose cross-entropy loss in TensorFlow?
- How to apply gradient clipping in TensorFlow?
- Keras + Tensorflow and Multiprocessing in Python
- How does Keras calculate the accuracy?
- Keras Sequential model input layer
- How to concatenate two layers in keras?
- Proper way to feed time-series data to stateful LSTM?
- Tensorflow: How to write op with gradient in python?
- ValueError at /image/ Tensor Tensor(“activation_5/Softmax:0”, shape=(?, 4), dtype=float32) is not an element of this graph
- TensorFlow operator overloading
- How to get other metrics in Tensorflow 2.0 (not only accuracy)?
- How to understand the term `tensor` in TensorFlow?
- Removing then Inserting a New Middle Layer in a Keras Model
- error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support
- How do I check if keras is using gpu version of tensorflow?
- Unbalanced data and weighted cross entropy
- What is the role of TimeDistributed layer in Keras?
- How to create a keras layer with a custom gradient in TF2.0?
- keras: how to save the training history attribute of the history object
- Tensorflow Precision / Recall / F1 score and Confusion matrix
- ‘Tensor’ object has no attribute ‘lower’
- How to construct a network with two inputs in PyTorch
- ValueError: Output tensors to a Model must be the output of a TensorFlow `Layer`
- Can I send callbacks to a KerasClassifier?
- TensorFlow, “‘module’ object has no attribute ‘placeholder'”
- How do you read Tensorboard files programmatically?