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

  • 相关阅读:
    华为OD机试 - 最小传输时延Ⅱ (Java 2023 B卷 200分)
    Day1 计算机网络的概念、组成、功能、分类
    未来10年,NAND 与DRAM依然是存储主角
    深入理解服务器进程管理与优化
    Java-多线程进阶
    3、IOC——基于注解管理bean
    用Redis实现延迟队列,我研究了两种方案,发现并不简单
    准备有空开发一个管理端代码生成器
    怎样做好金融投资翻译
    鸿蒙OpenHarmony【轻量系统烧录】 (基于Hi3861开发板)
  • 原文地址:https://blog.csdn.net/GenuineMonster/article/details/126308179