Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow 从元图检索变量名_Tensorflow - Fatal编程技术网

Tensorflow 从元图检索变量名

Tensorflow 从元图检索变量名,tensorflow,Tensorflow,我目前正在尝试从另一个项目(vizdoom平台上)检索经过训练的TF模型 我已成功地使用以下工具在新项目中导入模型: session = tf.Session() print("Loading model from: ", model_savefile) saver = tf.train.import_meta_graph(model_savefile + '.meta') saver.restore(session, model_savefile) 但是,我无法访问生成此保存文件的代码(我认

我目前正在尝试从另一个项目(vizdoom平台上)检索经过训练的TF模型

我已成功地使用以下工具在新项目中导入模型:

session = tf.Session()
print("Loading model from: ", model_savefile)
saver = tf.train.import_meta_graph(model_savefile + '.meta')
saver.restore(session, model_savefile)
但是,我无法访问生成此保存文件的代码(我认为它是通过OpenAI Gym生成的,但不确定),因此我不知道应该使用哪些名称为其提供输入

你知道怎么做吗


提前感谢

导入
元图
将向默认图添加操作

打印图形中的所有操作:

print(tf.get_default_graph().get_operations())
打印如下内容:

[<tf.Operation 'Placeholder' type=Placeholder>, <tf.Operation 'mul/y' type=Const>, <tf.Operation 'mul' type=Mul>]
[<tf.Operation 'Placeholder' type=Placeholder>]
打印如下内容:

[<tf.Operation 'Placeholder' type=Placeholder>, <tf.Operation 'mul/y' type=Const>, <tf.Operation 'mul' type=Mul>]
[<tf.Operation 'Placeholder' type=Placeholder>]
[]