问题描述:对网络结构做了些修改,导入已训练的参数,出现NotFoundError
相关程序:
#State where your log file is at.
log_dir = './log2'
#State where your checkpoint file is
checkpoint_file = './log/model.ckpt-300068'
#Define the scopes that you want to exclude for restoration
exclude = ['conv_0','conv_1','conv_2']
variables_to_restore = slim.get_variables_to_restore(exclude=exclude)
#Now we create a saver function that actually restores the variables from a checkpoint file in a sess
saver = tf.train.Saver(variables_to_restore)
def restore_fn(sess):
return saver.restore(sess,checkpoint_file)
sv = tf.train.Supervisor(logdir = log_dir,summary_op = None, init_fn = restore_fn)
报错:
问题原因:没有导入参数
问题语句: