Ubuntu16.04部署BEVformer 实时记录

一 配置依赖

a. Create a conda virtual environment and activate it.

conda create -n open-mmlab python=3.8 -y
conda activate open-mmlab

b. Install PyTorch and torchvision following the official instructions.

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
# Recommended torch>=1.9

安装torch相关内容时报错
Ubuntu16.04部署BEVformer 实时记录_第1张图片那就再安装scipy

pip install scipy
Looking in indexes: http://pypi.douban.com/simple
Collecting scipy
  Downloading http://pypi.doubanio.com/packages/69/f0/fb07a9548e48b687b8bf2fa81d71aba9cfc548d365046ca1c791e24db99d/scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB)
     |████████████████████████████████| 34.5 MB 587 kB/s 
Requirement already satisfied: numpy<1.27.0,>=1.19.5 in /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages (from scipy) (1.24.3)
Installing collected packages: scipy
Successfully installed scipy-1.10.1
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/jjuv/anaconda3/envs/open-mmlab/bin/python -m pip install --upgrade pip' command.

c. Install gcc>=5 in conda env (optional).

没有报错

conda install -c omgarcia gcc-6 # gcc-6.2

c. Install mmcv-full.

pip install mmcv-full==1.4.0
#  pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html

安装mmcv-full报错

(open-mmlab) jjuv@jjuv:~/Documents/yzh/BEVFormer$ pip install mmcv-full==1.4.0
Looking in indexes: http://pypi.douban.com/simple
Collecting mmcv-full==1.4.0
  Downloading http://pypi.doubanio.com/packages/48/ba/23bbe698dcd353f7684e1301f14290c9000ba126e43a64799aa86b4a6b92/mmcv-full-1.4.0.tar.gz (403 kB)
     |████████████████████████████████| 403 kB 789 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /home/jjuv/anaconda3/envs/open-mmlab/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u0atmgfg/mmcv-full_9110190bfbf64ecba950553cfd1d1939/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u0atmgfg/mmcv-full_9110190bfbf64ecba950553cfd1d1939/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-a0gb3vka
         cwd: /tmp/pip-install-u0atmgfg/mmcv-full_9110190bfbf64ecba950553cfd1d1939/
    Complete output (14 lines):
    /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at  ../c10/cuda/CUDAFunctions.cpp:115.)
      return torch._C._cuda_getDeviceCount() > 0
    Traceback (most recent call last):
      File "", line 1, in <module>
      File "/tmp/pip-install-u0atmgfg/mmcv-full_9110190bfbf64ecba950553cfd1d1939/setup.py", line 380, in <module>
        ext_modules=get_extensions(),
      File "/tmp/pip-install-u0atmgfg/mmcv-full_9110190bfbf64ecba950553cfd1d1939/setup.py", line 219, in get_extensions
        import psutil
      File "/home/jjuv/anaconda3/lib/python3.7/site-packages/psutil/__init__.py", line 96, in <module>
        from . import _pslinux as _psplatform
      File "/home/jjuv/anaconda3/lib/python3.7/site-packages/psutil/_pslinux.py", line 26, in <module>
        from . import _psutil_linux as cext
    ImportError: cannot import name '_psutil_linux' from partially initialized module 'psutil' (most likely due to a circular import) (/home/jjuv/anaconda3/lib/python3.7/site-packages/psutil/__init__.py)
    No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
    ----------------------------------------
WARNING: Discarding http://pypi.doubanio.com/packages/48/ba/23bbe698dcd353f7684e1301f14290c9000ba126e43a64799aa86b4a6b92/mmcv-full-1.4.0.tar.gz#sha256=fdd48a399c7ec81fe9db761cf4c1c7616ed98c476b4a4c0d191899435b5f90b1 (from http://pypi.doubanio.com/simple/mmcv-full/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mmcv-full==1.4.0 (from versions: 1.0rc0, 1.0rc2, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3.0, 1.3.1, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.3.15, 1.3.16, 1.3.17, 1.3.18, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1)
ERROR: No matching distribution found for mmcv-full==1.4.0
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/jjuv/anaconda3/envs/open-mmlab/bin/python -m pip install --upgrade pip' command.

我就去mmcv的github上面找,结果在v1.4.0这里找到了下面这句话

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html

我安装后,显示

Looking in indexes: http://pypi.douban.com/simple
Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html
Collecting mmcv-full
  Downloading https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/mmcv_full-1.7.1-cp38-cp38-manylinux1_x86_64.whl (47.7 MB)
     |████████████████████████████████| 47.7 MB 1.5 MB/s 
Requirement already satisfied: numpy in /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages (from mmcv-full) (1.24.3)
Collecting addict
  Downloading http://pypi.doubanio.com/packages/6a/00/b08f23b7d7e1e14ce01419a467b583edbb93c6cdb8654e54a9cc579cd61f/addict-2.4.0-py3-none-any.whl (3.8 kB)
Requirement already satisfied: yapf in /home/jjuv/anaconda3/lib/python3.7/site-packages (from mmcv-full) (0.28.0)
Requirement already satisfied: pyyaml in /home/jjuv/anaconda3/lib/python3.7/site-packages (from mmcv-full) (5.3)
Requirement already satisfied: packaging in /home/jjuv/anaconda3/lib/python3.7/site-packages (from mmcv-full) (20.1)
Requirement already satisfied: Pillow in /home/jjuv/anaconda3/lib/python3.7/site-packages (from mmcv-full) (7.0.0)
Requirement already satisfied: opencv-python>=3 in /home/jjuv/anaconda3/lib/python3.7/site-packages (from mmcv-full) (4.5.5.64)
Requirement already satisfied: six in /home/jjuv/anaconda3/lib/python3.7/site-packages (from packaging->mmcv-full) (1.14.0)
Requirement already satisfied: pyparsing>=2.0.2 in /home/jjuv/anaconda3/lib/python3.7/site-packages (from packaging->mmcv-full) (2.4.6)
Installing collected packages: addict, mmcv-full
Successfully installed addict-2.4.0 mmcv-full-1.7.1
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/jjuv/anaconda3/envs/open-mmlab/bin/python -m pip install --upgrade pip' command.

结果安装了1.7.1这个版本,先向后走吧,有问题的话,再来回溯。

d. Install mmdet and mmseg.

这一步的安装没有问题

pip install mmdet==2.14.0
pip install mmsegmentation==0.14.1

e. Install mmdet3d from source code.

git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
git checkout v0.17.1 # Other versions may not be compatible.
python setup.py install

安装mmdetection3d

git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
pip install -v -e .

报错

sing pip 21.2.2 from /home/jjuv/anaconda3/lib/python3.7/site-packages/pip (python 3.8)
Looking in indexes: http://pypi.douban.com/simple
Obtaining file:///home/jjuv/Documents/yzh/mmdetection3d
    Running command python setup.py egg_info
    /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/numpy/__init__.py:139: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
      from . import _distributor_init
    Traceback (most recent call last):
      File "", line 1, in <module>
      File "/home/jjuv/Documents/yzh/mmdetection3d/setup.py", line 10, in <module>
        import torch
      File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/__init__.py", line 605, in <module>
        _C._initExtension(manager_path())
      File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/cuda/__init__.py", line 607, in <module>
        from . import amp
      File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/cuda/amp/__init__.py", line 1, in <module>
        from .autocast_mode import autocast, custom_fwd, custom_bwd  # noqa: F401
      File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 6, in <module>
        import numpy as np
      File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/numpy/__init__.py", line 434, in <module>
        import mkl
      File "/home/jjuv/anaconda3/lib/python3.7/site-packages/mkl/__init__.py", line 49, in <module>
        from . import _mklinit
    ImportError: cannot import name '_mklinit' from partially initialized module 'mkl' (most likely due to a circular import) (/home/jjuv/anaconda3/lib/python3.7/site-packages/mkl/__init__.py)

numpy安装报错

ERROR: Cannot uninstall numpy 1.24.3, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.24.3'.

直接找到numpy的位置,删除后重新安装即可

python安装包报错“No such file or directory: ‘·····\numpy-1.21.2.dist-info\METADATA‘的解决办法

错误2

解决ERROR: Cannot uninstall ‘PyYAML‘. It is a distutils installed project and thus we cannot accuratel
报错

ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决

pip install --upgrade nni --ignore-installed

错误3

还是报错

Attempting uninstall: pyyaml
    Found existing installation: PyYAML 5.3
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

那就直接找到删除

pip show PyYAML

确定位置后,直接手动删除文件

pip show pyyaml
Name: PyYAML
Version: 5.3
Summary: YAML parser and emitter for Python
Home-page: https://github.com/yaml/pyyaml
Author: Kirill Simonov
Author-email: [email protected]
License: MIT
Location: /home/jjuv/anaconda3/lib/python3.7/site-packages
Requires: 
Required-by: rospkg, rosdistro, rosdep, distributed, conda-verify, conda-build, bokeh, anaconda-client, responses, nni, model-index, mmcv-full

我的文件只有一个
Ubuntu16.04部署BEVformer 实时记录_第2张图片

依然报错

执行

pip install -v -e .

依然报错

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
conda 4.12.0 requires ruamel_yaml_conda>=0.11.14, which is not installed.

我就自己安装ruamel_yaml_conda

pip install ruamel_yaml_conda

还是报错

Looking in indexes: http://pypi.douban.com/simple
Collecting ruamel_yaml_conda
  Downloading http://pypi.doubanio.com/packages/94/ef/31bfa8456e01ff13d8d98bdbc80ab2e592c830e52ccaff62c35d5f890357/ruamel_yaml_conda-0.15.80.tar.gz (202 kB)
     |████████████████████████████████| 202 kB 269 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /home/jjuv/anaconda3/envs/open-mmlab/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-byq0ngmp
         cwd: /tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/
    Complete output (18 lines):
    Traceback (most recent call last):
      File "/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/ruamel_yaml/__init__.py", line 21, in <module>
        from .main import *                               # NOQA
      File "/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/ruamel_yaml/main.py", line 12, in <module>
        import ruamel.yaml
    ModuleNotFoundError: No module named 'ruamel'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "", line 1, in <module>
      File "/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/setup.py", line 14, in <module>
        import ruamel_yaml  # NOQA
      File "/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/ruamel_yaml/__init__.py", line 23, in <module>
        from ruamel_yaml.main import *                               # NOQA
      File "/tmp/pip-install-0o3mr55f/ruamel-yaml-conda_eace7f47f0404d318cc86c9b202f1eb6/ruamel_yaml/main.py", line 12, in <module>
        import ruamel.yaml
    ModuleNotFoundError: No module named 'ruamel'
    ----------------------------------------
WARNING: Discarding http://pypi.doubanio.com/packages/94/ef/31bfa8456e01ff13d8d98bdbc80ab2e592c830e52ccaff62c35d5f890357/ruamel_yaml_conda-0.15.80.tar.gz#sha256=d0d3f33dfc40085e46de6729b64c2792755504a899ef1ab2e55233f882df9566 (from http://pypi.doubanio.com/simple/ruamel-yaml-conda/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement ruamel_yaml_conda (from versions: 0.15.80)
ERROR: No matching distribution found for ruamel_yaml_conda
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/jjuv/anaconda3/envs/open-mmlab/bin/python -m pip install --upgrade pip' command.

意思是找不到合适的版本的ruamel_yaml_conda
我又找了一下,发现网上很多针对ruamel_yaml_conda的都是对ruamel_yaml进行操作。
所以,我查看了一下ruamel_yaml

pip show ruamel_yaml

发现使用的是python3.7版本的

Name: ruamel_yaml
Version: 0.15.87
Summary: ruamel_yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
Home-page: UNKNOWN
Author: Anthon van der Neut
Author-email: [email protected]
License: UNKNOWN
Location: /home/jjuv/anaconda3/lib/python3.7/site-packages
Requires: 
Required-by: anaconda-project

这个仍然是没有办法通过

pip uninstall ruamel_yaml

删除。
所以只能够手动删除,找到位置,直接删除。(记得拷贝一份啊啊啊啊啊啊)
然后重新进行安装

pip install ruamel_yaml

再次进行尝试

pip install -v -e .

发现,成功了

Successfully installed mmdet3d

忽然发现应该安装指定版本的mmdetection3d

mmdetection3d-v0.17.1的github下载地址
但是还是报错

错误1

打开新的终端时,发现前面没有了(base),有点不详的预感。
启动虚拟环境

conda activate open-mmlab

报错

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 19, in get_yaml
    import ruamel_yaml as yaml
ModuleNotFoundError: No module named 'ruamel_yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 22, in get_yaml
    import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 142, in main
    from ..activate import main as activator_main
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/activate.py", line 22, in <module>
    from .base.context import ROOT_ENV_NAME, context, locate_prefix_by_name
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 32, in <module>
    from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/configuration.py", line 37, in <module>
    from .serialize import yaml_round_trip_load
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 30, in <module>
    yaml = get_yaml()
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/auxlib/decorators.py", line 59, in _memoized_func
    result = func(*args, **kwargs)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 24, in get_yaml
    raise ImportError("No yaml library available.\n"
ImportError: No yaml library available.
To proceed, conda install ruamel_yaml

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 19, in get_yaml
    import ruamel_yaml as yaml
ModuleNotFoundError: No module named 'ruamel_yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 22, in get_yaml
    import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 152, in main
    return ExceptionHandler().handle_exception(exc_val, exc_tb)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1129, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1140, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1195, in print_unexpected_error_report
    from .base.context import context
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 32, in <module>
    from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/configuration.py", line 37, in <module>
    from .serialize import yaml_round_trip_load
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 30, in <module>
    yaml = get_yaml()
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/auxlib/decorators.py", line 59, in _memoized_func
    result = func(*args, **kwargs)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/conda/common/serialize.py", line 24, in get_yaml
    raise ImportError("No yaml library available.\n"
ImportError: No yaml library available.
To proceed, conda install ruamel_yaml

通过观察可以发现,肯定是我们强行删除ruamel_yaml所带来的后遗症。
问题不大,再把原来的ruamel_yaml的文件拷贝过来就好了(还好我原来删除之前拷贝了一份)。
然后重新打开新的终端,发现问题消失了。
进入虚拟环境后,查看ruamel_yaml的位置也是新的python3.8的位置,没有再用原来python3.7的位置。(这也算是个小技巧吧)

还是没有成功,我就先往下面走了

还是不太行,我又回来了

执行

pip install -v -e .

报错

ERROR: Command errored out with exit status 1: /home/jjuv/anaconda3/envs/open-mmlab/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jjuv/Documents/yzh/mmdetection3d/setup.py'"'"'; __file__='"'"'/home/jjuv/Documents/yzh/mmdetection3d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

不太会解决,我又试了一下另一个安装命令

python setup.py develop

但是还是有问题,不过他没有红色的报错。我找了很久,在里面找到了一个关键的话,/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
所以,我就去看,发现自己的cuda使用的是9.0,而且里面没有cudnn,所以,就把它重新安装上。

running develop
/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running egg_info
writing mmdet3d.egg-info/PKG-INFO
writing dependency_links to mmdet3d.egg-info/dependency_links.txt
writing requirements to mmdet3d.egg-info/requires.txt
writing top-level names to mmdet3d.egg-info/top_level.txt
reading manifest file 'mmdet3d.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
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
building 'mmdet3d.ops.spconv.sparse_conv_ext' extension
/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py:284: UserWarning: 

                               !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) is not compatible with the compiler Pytorch was
built with for this platform, which is g++ on linux. Please
use g++ to to compile your extension. Alternatively, you may
compile PyTorch from source using c++, and then you can also use
c++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                              !! WARNING !!

  warnings.warn(WRONG_COMPILER_WARNING.format(
Emitting ninja build file /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/7] c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/all.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/all.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/all.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
[2/7] c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/indice.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
[3/7] /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/indice_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
[4/7] c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/maxpool.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
[5/7] /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/maxpool_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
[6/7] c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/reordering.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
[7/7] /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/reordering_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
FAILED: /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/indice_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
FAILED: /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/maxpool_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
FAILED: /usr/local/cuda/bin/nvcc  -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/reordering_cuda.cu -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -w -std=c++14 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61
/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
FAILED: c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/all.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/all.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/all.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/all.cc:15:30: fatal error: cuda_runtime_api.h: No such file or directory
 #include 
                              ^
compilation terminated.
FAILED: c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/maxpool.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/maxpool.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/spconv/maxpool.h:17:0,
                 from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/maxpool.cc:15:
/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/tensorview/tensorview.h:16:30: fatal error: cuda_runtime_api.h: No such file or directory
 #include 
                              ^
compilation terminated.
FAILED: c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/indice.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/indice.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/spconv/geometry.h:18:0,
                 from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/indice.cc:15:
/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/tensorview/tensorview.h:16:30: fatal error: cuda_runtime_api.h: No such file or directory
 #include 
                              ^
compilation terminated.
FAILED: c++ -MMD -MF /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering.o.d -pthread -B /home/jjuv/anaconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/TH -I/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/jjuv/anaconda3/envs/open-mmlab/include/python3.8 -c -c /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/reordering.cc -o /home/jjuv/Documents/yzh/mmdetection3d/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/spconv/src/reordering.o -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/spconv/reordering.h:17:0,
                 from /home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/src/reordering.cc:15:
/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/ops/spconv/include/tensorview/tensorview.h:16:30: fatal error: cuda_runtime_api.h: No such file or directory
 #include 
                              ^
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
    subprocess.run(
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "setup.py", line 192, in <module>
    setup(
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/command/develop.py", line 115, in install_for_development
    self.run_command('build_ext')
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
    build_ext.build_extensions(self)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
    self._build_extensions_serial()
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
    objects = self.compiler.compile(
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 530, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1355, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

搞定了cudnn后,再次安装

发现还是报错,是由于pandas需要的numpy版本太低了。

error: numpy 1.19.5 is installed but numpy>=1.20.3; python_version < "3.10" is required by {'pandas'}

于是我重新安装一个合适版本的numpy。
先查看numpy版本

pip show numpy

报错,原来是因为里面有两个numpy,但是默认的应该还是numpy 1.19.5,于是直接删除掉numpy-1.24.3.dist-info文件夹就行了。

WARNING: No metadata found in /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages
WARNING: No metadata found in /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages
ERROR: Exception:
Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/show.py", line 45, in run
    if not print_results(
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/show.py", line 202, in print_results
    for i, dist in enumerate(distributions):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/show.py", line 178, in search_packages_info
    requires=[req.name for req in dist.iter_dependencies()],
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_internal/metadata/pkg_resources.py", line 101, in iter_dependencies
    return self._dist.requires(extras)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
    dm = self._dep_map
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3032, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/numpy-1.24.3.dist-info/METADATA'

重新安装一个,但是又报错。原来是因为mmdet3d 0.17.1需要numpy版本小于1.20.0。这不就和前面的pandas冲突了吗!
而mmdet3d 0.17.1是BEVformer指定要求的,所以要以他为主。
于是需要重新安装适合版本的pandas。

mmdet3d 0.17.1 requires numpy<1.20.0, but you have numpy 1.24.3 which is incompatible.

经过一番挣扎,我找到了合适版本的numpy和pandas
pandas的官网版本挑选
可以从官网上面寻找想要安装的版本,可以一个一个的试。

pip install pandas==1.4.4
pip install numpy==1.19.5

搞定库了,继续进行安装

python setup.py develop

成功了

Finished processing dependencies for mmdet3d==0.17.1

f. Install timm.

pip install timm

g. Clone BEVFormer.

git clone https://github.com/fundamentalvision/BEVFormer.git

h. Prepare pretrained models.

cd bevformer
mkdir ckpts

cd ckpts & wget https://github.com/zhiqi-li/storage/releases/download/v1.0/r101_dcn_fcos3d_pretrain.pth

note: this pretrained model is the same model used in detr3d

二 准备数据(prepare_dataset.md)

Prepare nuScenes data

我使用的是nuScenes v1.0-mini。
We genetate custom annotation files which are different from mmdet3d’s

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

报错1

ImportError: /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBase8data_ptrIdEEPT_v

看了一下,应该是mmcv的问题
查看一下mmcv的位置和版本

pip show mmcv

发现没有mmcv
找到原来的安装的位置,发现安装的是mmcv-full
查看一下mmcv-full的版本

pip show mmcv-full

存在

Name: mmcv-full
Version: 1.7.1
Summary: OpenMMLab Computer Vision Foundation
Home-page: https://github.com/open-mmlab/mmcv
Author: MMCV Contributors
Author-email: [email protected]
License: 
Location: /home/jjuv/anaconda3/envs/open-mmlab/lib/python3.8/site-packages
Requires: addict, Pillow, opencv-python, numpy, packaging, yapf, pyyaml
Required-by: 

但是呢?和原来安装时候的要求不符
安装的时候说的是

pip install mmcv-full==1.4.0

现在变成了1.7.1
于是卸载重新安装

pip uninstall mmcv-full

这一次使用install.md中注释的内容进行安装。

pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html

搞定了mmdet3d重新回来,继续准备数据

conda activate open-mmlab
python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

还是报错

ImportError: cannot import name 'ft2font' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/jjuv/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py)

看来是matplotlib库的问题,可以看出这个库是在python3.7下面,那就更新一下。
但是直接安装matplotlib,他要求numpy的版本过高了。只能是选择安装指定版本的matplotlib了。

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
nuscenes-devkit 1.1.10 requires matplotlib<=3.5.2, but you have matplotlib 3.7.1 which is incompatible.
mmdet3d 0.17.1 requires numpy<1.20.0, but you have numpy 1.24.3 which is incompatible.

matplotlib的官网版本挑选
继续寻找合适版本的matplotlib。
我就根据nuscenes-devkit的要求,直接安装matplotlib3.5.2。

pip install matplotlib==3.5.2

但是他偷偷的又把numpy换成了numpy-1.24.3

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mmdet3d 0.17.1 requires numpy<1.20.0, but you have numpy 1.24.3 which is incompatible.

所以还需要重新安装numpy

pip install numpy==1.19.5

搞定了matplotlib,那就继续准备数据

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

还是报错

ModuleNotFoundError: No module named 'kiwisolver'

kiwisolver也是一个库
那就查看一下,发现已经有了,不过是python3.7的,那就重新安装一个吧。

搞定了kiwisolver,继续准备数据

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

还是报错
大体的意思就是,numba库的问题。
可以查看一下,然后选择重装。

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typeconv/typeconv.py", line 6, in <module>
    from . import _typeconv
ImportError: cannot import name '_typeconv' from 'numba.typeconv' (/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typeconv/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/create_data.py", line 6, in <module>
    from data_converter.create_gt_database import create_groundtruth_database
  File "/home/jjuv/Documents/yzh/BEVFormer/tools/data_converter/create_gt_database.py", line 11, in <module>
    from mmdet3d.core.bbox import box_np_ops as box_np_ops
  File "/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/core/__init__.py", line 4, in <module>
    from .evaluation import *  # noqa: F401, F403
  File "/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/core/evaluation/__init__.py", line 3, in <module>
    from .kitti_utils import kitti_eval, kitti_eval_coco_style
  File "/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/core/evaluation/kitti_utils/__init__.py", line 2, in <module>
    from .eval import kitti_eval, kitti_eval_coco_style
  File "/home/jjuv/Documents/yzh/mmdetection3d/mmdet3d/core/evaluation/kitti_utils/eval.py", line 4, in <module>
    import numba
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/__init__.py", line 18, in <module>
    from .special import (
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/special.py", line 7, in <module>
    from .typing.typeof import typeof
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typing/__init__.py", line 2, in <module>
    from .context import BaseContext, Context
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typing/context.py", line 12, in <module>
    from numba.typeconv import Conversion, rules
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typeconv/rules.py", line 3, in <module>
    from .typeconv import TypeManager, TypeCastingRules
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typeconv/typeconv.py", line 19, in <module>
    raise ImportError(msg % (url, reportme, str(e), sys.executable))
ImportError: Numba could not be imported.
If you are seeing this message and are undertaking Numba development work, you may need to re-run:

python setup.py build_ext --inplace

(Also, please check the development set up guide http://numba.pydata.org/numba-doc/latest/developer/contributing.html.)

If you are not working on Numba development:

Please report the error message and traceback, along with a minimal reproducer
at: https://github.com/numba/numba/issues/new

If more help is needed please feel free to speak to the Numba core developers
directly at: https://gitter.im/numba/numba

Thanks in advance for your help in improving Numba!

The original error was: 'cannot import name '_typeconv' from 'numba.typeconv' (/home/jjuv/anaconda3/lib/python3.7/site-packages/numba/typeconv/__init__.py)'
--------------------------------------------------------------------------------
If possible please include the following in your error report:

sys.executable: /home/jjuv/anaconda3/envs/open-mmlab/bin/python

搞定了numba,继续准备数据

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

还是报错
大体上意思就是,skimage库的问题

Traceback (most recent call last):
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/skimage/__init__.py", line 119, in <module>
    from ._shared import geometry
ImportError: cannot import name 'geometry' from 'skimage._shared' (/home/jjuv/anaconda3/lib/python3.7/site-packages/skimage/_shared/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/create_data.py", line 9, in <module>
    from data_converter import kitti_converter as kitti
  File "/home/jjuv/Documents/yzh/BEVFormer/tools/data_converter/kitti_converter.py", line 9, in <module>
    from .kitti_data_utils import get_kitti_image_info, get_waymo_image_info
  File "/home/jjuv/Documents/yzh/BEVFormer/tools/data_converter/kitti_data_utils.py", line 7, in <module>
    from skimage import io
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/skimage/__init__.py", line 122, in <module>
    _raise_build_error(e)
  File "/home/jjuv/anaconda3/lib/python3.7/site-packages/skimage/__init__.py", line 100, in _raise_build_error
    raise ImportError("""%s
ImportError: cannot import name 'geometry' from 'skimage._shared' (/home/jjuv/anaconda3/lib/python3.7/site-packages/skimage/_shared/__init__.py)
It seems that scikit-image has not been built correctly.

Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
https://scikit-image.org/docs/stable/install.html

但是好像没有skimage,准确的说应该叫scikit-image
于是,重新安装一下scikit-image,默认选择的是scikit-image-0.20.0
但是报错了

  Attempting uninstall: numpy
    Found existing installation: numpy 1.19.5
    Uninstalling numpy-1.19.5:
      Successfully uninstalled numpy-1.19.5
  Attempting uninstall: scipy
    Found existing installation: scipy 1.10.1
    Uninstalling scipy-1.10.1:
      Successfully uninstalled scipy-1.10.1
  Attempting uninstall: networkx
    Found existing installation: networkx 2.2
    Uninstalling networkx-2.2:
      Successfully uninstalled networkx-2.2

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mmdet3d 0.17.1 requires networkx<2.3,>=2.2, but you have networkx 3.1 which is incompatible.
mmdet3d 0.17.1 requires numpy<1.20.0, but you have numpy 1.24.3 which is incompatible.

scikit-image的官网版本挑选
那就试试0.19.3

pip install scikit-image==0.19.3

但是他安装的默认库的版本太高了,需要手动选择一下networkx和numpy的版本

pip install networkx==2.2
pip install numpy==1.19.5

搞定了scikit-image,继续准备数据

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0-mini --canbus ./data

哭了,终于成功了

各个依赖库总结下来

需要专门指定版本的库大概就是如下几个
mmcv-full
matplotlib
scikit-image
networkx
numpy
尽量按照我推荐的顺序安装,否则可能会出现前面安装了后面又被覆盖了的尴尬情况。

pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
pip install matplotlib==3.5.2
pip install scikit-image==0.19.3
pip install networkx==2.2
pip install numpy==1.19.5

跑一下(getting_started.md)

可以先了解一下不同FP的意思
FP32、FP16和INT8
Train BEVFormer with 8 GPUs

./tools/dist_train.sh ./projects/configs/bevformer/bevformer_base.py 8

推荐使用的是8个gpu,我没有那么多,只有1个。

./tools/dist_train.sh ./projects/configs/bevformer/bevformer_base.py 1

每看懂,里面写的是啥,先跑一下吧。
果然不太行@_@

RuntimeError: CUDA out of memory. Tried to allocate 1.59 GiB (GPU 0; 3.94 GiB total capacity; 2.51 GiB already allocated; 682.50 MiB free; 2.54 GiB reserved in total by PyTorch)
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 26554) of binary: /home/jjuv/anaconda3/envs/open-mmlab/bin/python
Traceback (most recent call last):

主要报错理由应该是算力不够

收笔。

你可能感兴趣的:(计算机视觉,python,开发语言)