Detectron.pytorch训练汇总

ImportError: cannot import name 'numpy_type_map'

Detectron.pytorch训练汇总_第1张图片

scatter_gather.py 注释numpy_type_map

并添加

numpy_type_map = {
    'float64': torch.DoubleTensor,
    'float32': torch.FloatTensor,
    'float16': torch.HalfTensor,
    'int64': torch.LongTensor,
    'int32': torch.IntTensor,
    'int16': torch.ShortTensor,
    'int8': torch.CharTensor,
    'uint8': torch.ByteTensor,
}

ImportError: No module named 'lib.utils.cython_bbox'

cd lib/

python setup.py install


from . import pypocketfft as pfft
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/server_gpu/anaconda3/envs/keypoint/lib/python3.6/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-36m-x86_64-linux-gnu.so)
 

更换scipy版本

pip install scipy==1.3.3

找不到版本移步:https://blog.csdn.net/weixin_41595062/article/details/105292950


ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

https://blog.csdn.net/ShuqiaoS/article/details/88420326


问题太多,我已转torch0.4.0

pip install numpy pyyaml opencv-python six packaging scipy cffi

conda install pycocotools

from lib.model.roi_pooling import lib as _lib, ffi as _ffi
ImportError: cannot import name 'lib'

运行make.sh


cffi.VerificationError: LinkError: command 'gcc' failed with exit status 1

export CUDA_PATH=/usr/local/cuda/
export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export CPATH=/usr/local/cuda-8.0/include${CPATH:+:${CPATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


添加以上到make.sh开头,并修改cuda-8.0为自己的版本


undefined symbol: __cudaPopCallConfiguration

import torch
torch.version.cuda

发现安装的torch0.4.0的torch.version.cuda=8.0。。。cuda=10.0。。。

conda install pytorch=0.4.0 torchvision cuda100 -c pytorch

每次conda总能遇到这种问题:

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'conda.anaconda.org\', port=443): Max retries exceeded with url: /pytorch/noarch/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

修改.condarc

如下

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: false

 

你可能感兴趣的:(Detectron.pytorch训练汇总)