Attempting to do the following:
import tensorflow as tf
from keras.models import load_model, Model
from keras import backend as K
sess = tf.compat.v1.Session()
K.set_session(sess)
When I run this in Google Colab I get:
RuntimeError: `set_session` is not available when using TensorFlow 2.0.
Does anyone know how to fix this?
try using the keras backend from the tensorflow path. Your code gives me an error, but this works for me.
import tensorflow as tf
from tensorflow.keras.models import load_model, Model
from tensorflow.python.keras import backend as K
sess = tf.compat.v1.Session()
K.set_session(sess)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With