You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to use separate Tensorflow graphs when loading and using each model. If you are using Keras, you also need to use separate sessions. See:
import tensorflow as tf
graph1 = tf.Graph()
with graph1.as_default():
session1 = tf.Session()
with session1.as_default():
model1 = Detector('checkpoint1')
graph2 = tf.Graph()
with graph2.as_default():
session2 = tf.Session()
with session2.as_default():
model2 = Detector('checkpoint2')
with graph1.as_default():
with session1.as_default():
model1.predict(img)
with graph2.as_default():
with session2.as_default():
model2.predict(img)
I tried loading two checkpoints as follows. However, loading only one (either) works fine.
System:
Basically, I need to load multiple checkpoints in memory and use one of them based on a parameter provided by the user.
The text was updated successfully, but these errors were encountered: