报错详情:
使用faster-rcnn训练自己的模型,下载使用别人的代码
这份代码
运行python tools/demo.py报错
如下:

Traceback (most recent call last):File "tools/demo.py", line 145, in <module>saver.restore(sess, tfmodel)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 1312, in restoreerr, "a mismatch between the current graph and the graph")
tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:Assign requires shapes of both tensors to match. lhs shape= [2048,84] rhs shape= [2048,20][[node save/Assign_1 (defined at tools/demo.py:144) ]]Caused by op 'save/Assign_1', defined at:File "tools/demo.py", line 144, in <module>saver = tf.train.Saver()File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 832, in __init__self.build()File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 844, in buildself._build(self._filename, build_save=True, build_restore=True)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 881, in _buildbuild_save=build_save, build_restore=build_restore)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 513, in _build_internalrestore_sequentially, reshape)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 354, in _AddRestoreOpsassign_ops.append(saveable.restore(saveable_tensors, shapes))File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saving/saveable_object_util.py", line 73, in restoreself.op.get_shape().is_fully_defined())File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/state_ops.py", line 223, in assignvalidate_shape=validate_shape)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 64, in assignuse_locking=use_locking, name=name)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helperop_def=op_def)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_funcreturn func(*args, **kwargs)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3300, in create_opop_def=op_def)File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 1801, in __init__self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:Assign requires shapes of both tensors to match. lhs shape= [2048,84] rhs shape= [2048,20][[node save/Assign_1 (defined at tools/demo.py:144) ]]

原因:

#加载模型
demo.py文件
net.create_architecture("TEST", 21, tag='default', anchor_scales=[8, 16, 32])
对比test_net.py文件
net.create_architecture("TEST", imdb.num_classes,tag='default',anchor_scales=cfg.ANCHOR_SCALES,anchor_ratios=cfg.ANCHOR_RATIOS)       

对比:21 和 imdb.num_classes
可知这个位置的参数代表种类数目,要改成自己的。

报错InvalidArgumentError (see above for traceback): Restoring from checkpoint failed相关推荐

  1. tensorflow报错a Variable name or other graph key that is missin, Restoring from checkpoint failed. T

    报错 Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key t ...

  2. docker 报错 /usr/bin/docker-current: Error response from daemon: driver failed programming external

    现象:centos7 下docker启动容器报错 /usr/bin/docker-current: Error response from daemon: driver failed programm ...

  3. 【IDEA 报错 ERROR 16720 --- [ restartedMain] o.a.coyote.http11.Http11NioProtocol : Failed to sta】

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 IDEA 报错 ERROR 16720 - [ restartedMain] o.a.coyote.http11.Http11NioP ...

  4. Mac安装HomeBrew及update报错Error: Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask failed

    Mac安装HomeBrew及update报错Error: Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask failed! 报错 运 ...

  5. DNS服务--nslookup解析报错UnKnown 找不到 www.xxx.com: Server failed

    - 问题:nslookup www.xxx.com 报错 *** UnKnown 找不到 www.xxx.com: Server failed - 问题所在 /var/named/下面xxx.com. ...

  6. NotFoundError: Restoring from checkpoint failed. 解决

    遇到的问题: tensorflow版本:tensorflow1.13.1-gpu 今天在学习tensorflow的模型保存和载入中出现以下BUG NotFoundError: Restoring fr ...

  7. tensorflow Restoring from checkpoint failed

    发生异常: tensorflow.python.framework.errors_impl.InvalidArgumentError Restoring from checkpoint failed. ...

  8. Spyder:NotFoundError: Restoring from checkpoint failed.

    Tensorflow加载模型错误: NotFoundError: Restoring from checkpoint failed. This is most likely due to a Vari ...

  9. 在跑FIA时遇到的问题Restoring from checkpoint failed. This is most likely due to a Variable name or other gra

    问题: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key ...

最新文章

  1. python操作yaml的方法详解
  2. python学习:函数传参数
  3. FireFox不支持cursor:hand
  4. 《OD大数据实战》MongoDB环境搭建
  5. DOM文档加载的步骤:
  6. 机器学习(六)支持向量机svm初级篇
  7. 嵌入式MicroFlighter 之STM32F103学习——编写第一个STM32程序
  8. 项目常用工具类整理(一)--时间工具类DateUtil.java
  9. python自动化办公真的好用吗-用 Python 自动化办公能做到哪些有趣或有用的事情?...
  10. 限流, 熔断,降级笔记
  11. 2020最新录制原生淘宝客APP视频搭建教程【最新原创】
  12. python中集合可以使用下标吗_Python之集合
  13. 铁血战士之异形大战铁血战士2 观感
  14. 中国山梨酸市场运营动态分析与前景方向预测报告2022-2028年
  15. Windows 文件夹或文件名 太长无法删除怎么办? 一招教你怎样解决.
  16. Power BI中突出显示矩阵的最大值与最小值
  17. 关于“马甲app”你不得不知的一些常识
  18. ArduPilot之开源代码Sensor Drivers设计
  19. dev 服务器调试过程
  20. java中的失败重试机制总结

热门文章

  1. 比例阀放大器10KΩ电位器控制指令输入接线图
  2. 数据分析面试经验(给自己一个梳理的过程)
  3. tab bar 与 toolbar使用的区别
  4. 20 ubuntu 中科大源_Ubuntu 18.04换国内源 中科大源 阿里源 163源 清华源
  5. 思科网关冗余协议配置
  6. 计算机辅助协同工作总结,计算机辅助设计1课程小结.docx
  7. IBS2.0绘制蛋白质,核酸结构
  8. 蓝桥杯单片机之独立按键+外部中断
  9. SimpleFOC之ESP32(七)—— 霍尔电机
  10. data flow(数据流图)