Bug排错:AssertionError:Config file {cfg_filename} does not exist,detectron2报错

跑程序时遇到了这个错误,困扰了整整一下午,下面是解决过程。
在这里插入图片描述
step1: 由报错信息可以定位到报错来源detectron2/detectron2/config/config.py ,打开py文件后,发现是如下地方报错
在这里插入图片描述
step2: 很明显可以看到原因是cfg_filename这个文件夹不存在或者为空。于是打开主文件也就是需要运行的文件,找到使用merge_from_file这个函数的地方
在这里插入图片描述
step3: 于是恍然大悟原来是config_file这个文件夹没有定义,于是简单粗暴的直接给config_file添加路径。再次运行时错误消失,运行成功。
在这里插入图片描述

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 14
    评论
根据引用中的资料,正确的导入方式是从tensorflow中导入keras模块。对于属性'Pooling2D'的错误提示,可能是因为该属性在导入时使用了错误的命名空间。 您可以尝试使用以下导入方式来解决此问题: ``` from tensorflow.keras.layers import MaxPooling2D ``` 这样,您就可以正确地使用MaxPooling2D模块了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [AttributeError: module 'tensorflow.compat.v1' has no attribute '](https://download.csdn.net/download/qq_38766019/86272235)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [菜尼奥排错之keras ‘tensorflow.compat.v2.__internal__‘ has no attribute ‘register_clear_session_...](https://blog.csdn.net/yueyueniaolzp/article/details/121820916)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [module ‘tensorflow.compat.v2.__internal__‘ has no attribute ‘tf2](https://blog.csdn.net/weixin_44731100/article/details/121356206)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tomorrow;

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值