【发布时间】:2019-07-25 05:30:27
【问题描述】:
我正在使用 TensorFlow 使用 Python 3.6,但问题是 saver.save 无法正常工作。
我必须将九个不同的sess 保存到九个文件model_path,但我只有五个文件,当我打印sess 和model_path 时,我得到了九个结果。
def save_models(sess, model_path):
""" Save models to the current directory with the name filename """
current_dir = os.path.dirname(os.path.realpath(__file__))
model_path = os.path.join(current_dir, "model/" + model_path)
if not os.path.exists(os.path.dirname(model_path)):
os.makedirs(os.path.dirname(model_path))
saver.save(sess, model_path, write_meta_graph=False)
我得到了这些文件,这意味着它只保存从agent_3 和model_path 从agent_0 开始
【问题讨论】:
标签: python-3.x tensorflow