from baselines import logger
logger.warn("save_state method is deprecated, please use save_variables instead")
sess = sess or get_session()
os.makedirs(os.path.dirname(fname), exist_ok=True)
saver = tf.train.Saver()
saver.save(tf.get_default_session(), fname)
// The methods above and below are clearly doing the same thing, and in a rather similar way
After Change
from baselines import logger
logger.warn("save_state method is deprecated, please use save_variables instead")
sess = sess or get_session()
dirname = os.path.dirname(fname)if any(dirname):
os.makedirs(dirname, exist_ok=True)
saver = tf.train.Saver()
saver.save(tf.get_default_session(), fname)
// The methods above and below are clearly doing the same thing, and in a rather similar way