问题1
创建环境时安装mmcv-full==1.3.13一直报错,可以先安装这个mmcv-full==1.3.13再安装pytorch;
问题2
ERROR: Exception:
Traceback (most recent call last):
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 494, in run
installed = install_given_reqs(
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 73, in install_given_reqs
requirement.install(
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 792, in install
install_wheel(
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py", line 729, in install_wheel
_install_wheel(
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py", line 589, in _install_wheel
file.save()
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py", line 388, in save
shutil.copyfileobj(f, dest)
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/shutil.py", line 202, in copyfileobj
buf = fsrc_read(length)
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/zipfile.py", line 907, in read
data = self._read1(n)
File "/home/wxq/anaconda3/envs/devd/lib/python3.8/zipfile.py", line 983, in _read1
data = self._decompressor.decompress(data, n)
zlib.error: Error -3 while decompressing data: invalid distance too far back
安装后续包报错如下,需要自己先安装pillow
conda install Pillow
问题3
安装后续所有需求包,报错:
/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/wxq/anaconda3/envs/devd/lib/python3.8/site-packages/torch/utils/cpp_extension.py:387: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
warning: no files found matching '*.cpp' under directory 'mmdet3d/.mim/ops'
warning: no files found matching '*.cu' under directory 'mmdet3d/.mim/ops'
warning: no files found matching '*.h' under directory 'mmdet3d/.mim/ops'
warning: no files found matching '*.cc' under directory 'mmdet3d/.mim/ops'
adding license file 'LICENSE'
writing manifest file 'mmdet3d.egg-info/SOURCES.txt'
running build_ext
error: [Errno 2] No such file or directory: '/usr/local/cuda/bin/nvcc'
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/wxq/anaconda3/envs/devd/bin/python3.8 -c '
exec(compile('"'"''"'"''"'"'
# This is -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
# import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
# setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
# manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize
try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute `setup.py` since setuptools is not available in "
"the build environment.",
file=sys.stderr,
)
sys.exit(1)
__file__ = %r
sys.argv[0] = __file__
if os.path.exists(__file__):
filename = __file__
with tokenize.open(__file__) as f:
setup_py_code = f.read()
else:
filename = ""
setup_py_code = "from setuptools import setup; setup()"
exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/wxq/BEVDet/setup.py'"'"',), "", "exec"))' develop --no-deps
cwd: /home/wxq/BEVDet/
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
修改
修改.bashrc文件
sudo gedit ~/.bashrc
将原有CUDA的环境文件修改
原来的:
export CUDA_HOME=/usr/local/cuda/bin
修改后:
export CUDA_HOME=/usr/local/cuda-11.3
(上面的看一下自己的路径,自己的cuda是啥,就写cuda-xxxx)
记得source一下,使环境文件生效
source ~/.bashrc
问题4继续报错
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
mmdet3d/ops/ball_query/src/ball_query.cpp:4:10: fatal error: THC/THC.h: 没有那个文件或目录
#include
^~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/wxq/anaconda3/envs/devd/bin/python3.8 -c '
exec(compile('"'"''"'"''"'"'
# This is -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
# import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
# setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
# manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize
try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute `setup.py` since setuptools is not available in "
"the build environment.",
file=sys.stderr,
)
sys.exit(1)
__file__ = %r
sys.argv[0] = __file__
if os.path.exists(__file__):
filename = __file__
with tokenize.open(__file__) as f:
setup_py_code = f.read()
else:
filename = ""
setup_py_code = "from setuptools import setup; setup()"
exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/wxq/BEVDet/setup.py'"'"',), "", "exec"))' develop --no-deps
cwd: /home/wxq/BEVDet/
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
解决方法(PointTransformer编译pointops_cuda报错fatal error: THC/THC.h: No such file or directory_3D_DLW的博客-CSDN博客)
原因是pytorch 1.9
之后的某个版本删除了THC.h
, 参考 fatal error: THC/THC.h: No such file or directory - CSDN。
我使用的是下述方法:Ctrl+Shift+F
全局搜索并删除每一行#include
繼續問題:
ImportError: cannot import name ‘ball_query_ext’ from ‘mmdet3d.ops.ball_query’ (/opt/sdatmp/lq/project/gitproject/mmdetection3d/mmdet3d/ops/ball_query/init.py)
感觉是编译的时候,目录应该多一级/src/:
warning: no files found matching ‘mmdet3d/ops//*.cpp’
warning: no files found matching 'mmdet3d/ops//.cu’
warning: no files found matching 'mmdet3d/ops/**/.h’
warning: no files found matching ‘mmdet3d/ops/**/*.cc’
warning: no files found matching ‘mmdet3d/VERSION’
知乎大佬说g++也要5.4
sudo apt install gcc-5 g++-5
#查看路径下是否存在多版本的gcc/g++
ls /usr/bin/gcc*
ls /usr/bin/g++*
#指定软连接gcc-5和g+±5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5
最后测试一下,分别都是对应版本5.5.0
gcc -v
g++ -v
终于successful了,喜极而泣!!!
Installed /home/wxq/BEVDet-dev2.0
Successfully installed llvmlite-0.36.0 mmdet3d-1.0.0rc4 numba-0.53.0