Thi*_*eur 9 python tensorflow google-cloud-ml
我正在使用Tensorflow r0.12.
我在本地使用google-cloud-ml来运行2个不同的培训工作.在第一份工作中,我找到了我的变量的良好初始值.我将它们存储在V2检查点中.
当我尝试恢复我的变量以便在第二个作业中使用它们时:
import tensorflow as tf
sess = tf.Session()
new_saver = tf.train.import_meta_graph('../variables_pred/model.ckpt-10151.meta', clear_devices=True)
new_saver.restore(sess, tf.train.latest_checkpoint('../variables_pred/'))
all_vars = tf.trainable_variables()
for v in all_vars:
print(v.name)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
tensorflow.python.framework.errors_impl.InternalError: Unable to get element from the feed as bytes.
Run Code Online (Sandbox Code Playgroud)
在第一个作业中使用这些行创建检查点:
saver = tf.train.Saver()
saver.export_meta_graph(filename=os.path.join(output_dir, 'export.meta'))
saver.save(sess, os.path.join(output_dir, 'export'), write_meta_graph=False)
Run Code Online (Sandbox Code Playgroud)
根据这个答案,它可能来自缺少元数据文件,但我正在加载元数据文件.
PS:我使用这个论点clear_devices=True是因为在google-cloud-ml上发布产生的设备规格非常错综复杂,我不需要一定得到同样的调度.
| 归档时间: |
|
| 查看次数: |
9077 次 |
| 最近记录: |