• 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'

  • 相关阅读:
    Spring高手之路14——深入浅出:SPI机制在JDK与Spring Boot中的应用
    「Windows Bug」Window 系统下双网卡内外网冲突
    Vue 3.3 发布
    Linux环境安装mysql8.0
    福昕阅读器打开pdf文档时显示的标题不是文件名
    等精度频率计verilog,quartus仿真视频,原理图,代码
    杨氏双缝干涉条纹matlab实现
    OpenCV | 直线拟合fitline函数(Python)
    Pandas简单使用Series和DataFrame
    为什么要用 B+ 树,而不用普通二叉树?
  • 原文地址:https://blog.csdn.net/GenuineMonster/article/details/126308179