【发布时间】:2019-07-13 08:30:39
【问题描述】:
我想训练一个网络,然后将该网络用作特征提取器;所以我想像一个函数一样保存这个。
我知道如何保存经过训练的模型并重用模型 I,但我想将此经过训练的模型用作我的新图表的一部分,就像函数一样,请参见下面的结构。
我想我可能需要将新图附加到旧模型图并修复旧模型的参数。谁能给我一些关于如何做到这一点的想法?谢谢。
# define a graph and train a model called mdl in a session
# this mdl will be fixed used in the new graph
# start a new graph
cae_in = tf.placeholder(tf.float32,(None,a,b,1))
cae_out = tf.placeholder(tf.float32,(None,a,b,1))
# use this model to process my input
loss = mdl(cae_in) - cae_out
with tf.Session() as sess:
# run this sess
【问题讨论】:
标签: python tensorflow deep-learning