• NanoDet-plus环境搭建过程中可能出现的BUG及解决方法


     一、问题一:AttributeError: 'NoneType' object has no attribute 'seek'. You can only torch.load from a file that is seekable

    1. Q1:
    2. AttributeError: 'NoneType' object has no attribute 'seek'.
    3. You can only torch.load from a file that is seekable

    A1:出现这样的问题,很好解决,就是字面意思。检查一下你的权重文件是否和当前的源码版本匹配,比如源码是v1.0.0的版本,你用的是别的版本的权重或者是根本没指定权重的路径。 可以在下次执行命令时指定权重文件的路径,应该就能解决类似这样的问题了。

    二、问题二: Torch not compiled with CUDA enabled

    1. Q2:
    2. Torch not compiled with CUDA enabled

    A2:这个问题是CUDA版本和Pytorch版本不匹配所导致的,NanoDet-plus的requirements.txt中对Pytorch的要求不是很明确,几乎是默认安装最新的torch1.12.0(且不论是CPU版的还是GPU版的)解决问题的方法是查看已安装的CUDA的版本,到Pytorch官网查看对应版本的Pytorch并下载下来。或者是更换CUDA的版本。记得在上述操作之后,再次使用命令行:

    python setup.py develop

    三、问题三:AttributeError:module “distutils” has no attribute “version”

    1. Q3:
    2. AttributeError:module “distutils” has no attribute “version”

     A3:这个问题出现的原因是setuptools版本过高或者过低(或者你自己更换其他的版本试一下),自己尝试之后选择了这个版本的:setuptools==59.5.0。安装命令为:

    pip install setuptools==59.5.0

    四、问题四:Hint: This means that multiple copies of the OpenMP runtime have been linked into the program.Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

    1. Q4:
    2. Hint: This means that multiple copies of the OpenMP runtime have been linked into the program.Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

    A4:配置好NanoDet-plus环境之后进行测试图片的推理,可能会出现这个报错,主要是推理结果可视化的过程时出现了问题,这与matplotlib库有关。可以更换版本或重新安装一下。如果还未能解决此问题,那么 可以尝试在demo.py的合适位置增添如下两行代码:

    1. import os
    2. os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'

  • 相关阅读:
    方舟建筑代码指令大全
    Linux下的第一个小程序——进度条
    Bean 作用域和生命周期
    ET框架6.0分析三、网络通信
    攻防世界----easytornado笔记
    掌握苏宁API,一键获取商品详情,解锁无尽商业可能
    抖音播映量破500的原因找到了,不是内容不好,而是这5个功能
    《微服务架构设计模式》第一章
    ClickHouse教程 — 第二章 ClickHouse快速入门
    1921. 消灭怪物的最大数量
  • 原文地址:https://blog.csdn.net/GenuineMonster/article/details/126308179