dopamine
dopamine copied to clipboard
How to load checkpoint as an independent TF/Keras model for utilizing?
Hi,
Is there any example code about how to load the checkpoint (https://github.com/google/dopamine/tree/master/docs#downloads) that can be utilized independently? For instance, I use openAI gym to create an environment and utilize your checkpoint model to predict actions.
Many thanks and stay safe.
I've been working on the same thing. Try this, changing the paths and the "24" (the iteration checkpoint to use) as necessary:
import tensorflow.compat.v1 as tf
with tf.Session() as sess:
saver = tf.train.import_meta_graph('{path/to/base/dir}/checkpoints/tf_ckpt-24.meta', clear_devices=True)
saver.restore(sess, tf.train.latest_checkpoint('{path/to/base/dir}/checkpoints'))
Using Dopamine is my first trial-by-fire with Tensorflow, so I'm not sure of meaningful next steps yet after opening the session, but hopefully this first step can help you some.