程序开发BUG修复记录1

程序1-----https://github.com/csuhan/s2anet

bug1:ImportError: cannot import name 'get_dist_info' from 'mmcv.runner.utils' (/home/zyt/anaconda3/envs/s2anet/lib/python3.7/site-packages/mmcv/runner/utils.py)

原因: 可能是版本更新问题, mmcv.runner.utils下面只定义了get_host_info():确实没有定义get_dist_info, 回溯错误的上一行:from .sampler import DistributedGroupSampler, DistributedSampler, GroupSampler 原来是在sampler这个包中导入的错误。

解决: 将build_loader.py    sampler.py中的from mmcv.runner.utils import get_dist_info 注释掉.

bug2:pip安装时出现THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE

 原因:由于网速等原因,需要重复使用命令:【pip install XXXXX】安装XXXXX,此时看你会报错:

           THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE

解决: 使用命令【pip install --upgrade XXXXX】即可解决。

bug3 :cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/highgui/src/window.cpp:615: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

原因: 安装opencv时编译配置出现了问题

解决: 使用命令

        conda remove opencv
        conda install -c menpo opencv

        pip install --upgrade pip
        pip install opencv-contrib-python

具体环境配置过程:
a. Create a conda virtual environment and activate it.
    conda create -n s2anet-d2det python=3.6 -y
    conda activate s2anet-d2det
b. Install PyTorch stable or nightly and torchvision following the official instructions, e.g.,
    conda install pytorch=1.3 torchvision cudatoolkit=10.0 -c pytorch
    pip3 install torchstat
    pip install -v -e .
    pip install pycocotools
    pip install summary
    pip install PyWavelets
    pip install torchsummary
d. Install s2anet
    cd s2anet
    pip install -r requirements.txt
    python setup.py develop
    # or "pip install -v -e ."
e. Install DOTA_devkit
    sudo apt-get install swig
    cd DOTA_devkit/polyiou
    swig -c++ -python csrc/polyiou.i
    python setup.py build_ext --inplace

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值