This is most likely due to a Variable name or other graph key that is missing from the checkpoint. P

Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
具体报错见下图:
在这里插入图片描述
上面报错的位置在我加载了之前训练好的模型参数上,在网上查找了好久,一种说法是在此处,意思是用了同一个网络,不同的参数作了两次训练,服务器上存储的是第一个网络的参数,当先测试过第一个,再测试第二个就会报错。
我想了很久,不像是这个错误,后来在老师的帮助下才发现问题。
这是之前的部分代码:
在这里插入图片描述
这是改进后的部分代码:
在这里插入图片描述
我是在加载预定义模型和初始化这些参数之间的逻辑没有搞清楚,才会报上面那种错误,还是得多学习多思考才行。

猜你喜欢

转载自blog.csdn.net/qq_44846512/article/details/111960414
今日推荐