tensorflow恢复restore官网ckpt出错,Tensor name not found搭建好vgg,resnet等网络,加载tensorflow官网(https://github.com/tensorflow/models/tree/master/research/slim)提供的预训练ckpt模型.
使用restore运行出错,一些节点(conv/biases)在ckpt中不存在,出错无法运行.正确的做法,
slim.assign_from_checkpoint_fn(’./data/pre_trained/resnet_v1_50.ckpt’,
slim.get_trainable_variables(),
ignore_missing_vars=True)

with tf.Session() as sess:
sess.run(init)
# resotre 预训练模型
variable_restore_op(sess)

运行会提醒丢失的,无法加载的模型参数,程序正常运行.

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2022-03-08
  • 2021-09-01
  • 2021-04-01
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2022-01-27
  • 2021-12-06
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案