Sense-GVT / Fast-BEV

Fast-BEV: A Fast and Strong Bird’s-Eye View Perception Baseline
Other
568 stars 85 forks source link

Help on installation #69

Closed LaCandela closed 8 months ago

LaCandela commented 11 months ago

Could you please guide me on how to install this repo? If do pip install -v -e . I get the error messages that seems hard to be resolved. I am using Anaconda python3.9.7 on Ubuntu 20.04 in Docker. Looks like a problem with the llvm installation,,,

Attempting uninstall: llvmlite Found existing installation: llvmlite 0.37.0 Uninstalling llvmlite-0.37.0: Removing file or directory /opt/anaconda3/lib/python3.9/site-packages/llvmlite Removing file or directory /opt/anaconda3/lib/python3.9/site-packages/llvmlite-0.37.0-py3.9.egg-info Successfully uninstalled llvmlite-0.37.0 Running command /opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/setup.py'"'"'; file='"'"'/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/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'"'"'))' install --record /tmp/pip-record-cta4o70s/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.9/llvmlite running install running build got version from file /tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/llvmlite/_version.py {'version': '0.33.0', 'full': '76c8ecba36e23fa8b6878505a1afc8a3d7a2c8a1'} running build_ext /opt/anaconda3/bin/python /tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/ffi/build.py LLVM version... Traceback (most recent call last): File "/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/ffi/build.py", line 105, in main_posix out = subprocess.check_output([llvm_config, '--version']) File "/opt/anaconda3/lib/python3.9/subprocess.py", line 424, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/opt/anaconda3/lib/python3.9/subprocess.py", line 505, in run with Popen(popenargs, **kwargs) as process: File "/opt/anaconda3/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/opt/anaconda3/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/ffi/build.py", line 191, in <module>
    main()
  File "/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/ffi/build.py", line 181, in main
    main_posix('linux', '.so')
  File "/tmp/pip-install-21lqd5ba/llvmlite_e4b23717c00147a19c1bd6c17a0e9c43/ffi/build.py", line 107, in main_posix
    raise RuntimeError("%s failed executing, please point LLVM_CONFIG "
RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
error: command '/opt/anaconda3/bin/python' failed with exit code 1
Running setup.py install for llvmlite ... error
ASONG0506 commented 9 months ago

Could you please guide me on how to install this repo? If do pip install -v -e . I get the error messages that seems hard to be resolved. I am using Anaconda python3.9.7 on Ubuntu 20.04 in Docker. Looks like a problem with the llvm installation,,,

modify these lines in setup.py

        # setup_requires=parse_requirements('requirements/build.txt'),
        # tests_require=parse_requirements('requirements/tests.txt'),
        # install_requires=parse_requirements('requirements/runtime.txt'),
        # extras_require={
        #     'all': parse_requirements('requirements.txt'),
        #     'tests': parse_requirements('requirements/tests.txt'),
        #     'build': parse_requirements('requirements/build.txt'),
        #     'optional': parse_requirements('requirements/optional.txt'),
        # },
LaCandela commented 9 months ago

@ASONG0506 I commented out the lines that you recomended and I got different errors:

pip install -v -e . Using pip 20.2.4 from /opt/anaconda3/lib/python3.8/site-packages/pip (python 3.8) Non-user install because site-packages writeable Created temporary directory: /tmp/pip-ephem-wheel-cache-d7viat3c Created temporary directory: /tmp/pip-req-tracker-pbp_7kuq Initialized build tracking at /tmp/pip-req-tracker-pbp_7kuq Created build tracker: /tmp/pip-req-tracker-pbp_7kuq Entered build tracker: /tmp/pip-req-tracker-pbp_7kuq Created temporary directory: /tmp/pip-install-rwsu1t7r Obtaining file:///Fast-BEV Added file:///Fast-BEV to build tracker '/tmp/pip-req-tracker-pbp_7kuq' Running setup.py (path:/Fast-BEV/setup.py) egg_info for package from file:///Fast-BEV Created temporary directory: /tmp/pip-pip-egg-info-hwo7zxzi Running command python setup.py egg_info running egg_info creating /tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info writing /tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/PKG-INFO writing dependency_links to /tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/dependency_links.txt writing top-level names to /tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/top_level.txt writing manifest file '/tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/SOURCES.txt' reading manifest file '/tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' /opt/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py:476: 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' writing manifest file '/tmp/pip-pip-egg-info-hwo7zxzi/mmdet3d.egg-info/SOURCES.txt' Source in /Fast-BEV has version 0.16.0, which satisfies requirement mmdet3d==0.16.0 from file:///Fast-BEV Removed mmdet3d==0.16.0 from file:///Fast-BEV from build tracker '/tmp/pip-req-tracker-pbp_7kuq' Installing collected packages: mmdet3d Running setup.py develop for mmdet3d Running command /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Fast-BEV/setup.py'"'"'; file='"'"'/Fast-BEV/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps running develop running egg_info writing mmdet3d.egg-info/PKG-INFO writing dependency_links to mmdet3d.egg-info/dependency_links.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' /opt/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py:476: 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' writing manifest file 'mmdet3d.egg-info/SOURCES.txt' running build_ext building 'mmdet3d.ops.ball_query.ball_query_ext' extension gcc -pthread -B /opt/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/opt/anaconda3/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/anaconda3/include/python3.8 -c mmdet3d/ops/ball_query/src/ball_query.cpp -o build/temp.linux-x86_64-3.8/mmdet3d/ops/ball_query/src/ball_query.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=ball_query_ext -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 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: No such file or directory 4 | #include <THC/THC.h> | ^~~ compilation terminated. /opt/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py:388: UserWarning: The detected CUDA version (11.4) has a minor version mismatch with the version that was used to compile PyTorch (11.7). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) error: command 'gcc' failed with exit status 1 ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Fast-BEV/setup.py'"'"'; file='"'"'/Fast-BEV/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output. Exception information: Traceback (most recent call last): File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 228, in _main status = self.run(options, args) File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper return func(self, options, args) File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 397, in run installed = install_given_reqs( File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/req/init.py", line 82, in install_given_reqs requirement.install( File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 790, in install install_editable_legacy( File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/operations/install/editable_legacy.py", line 49, in install_editable call_subprocess( File "/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess raise InstallationError(exc_msg) pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Fast-BEV/setup.py'"'"'; file='"'"'/Fast-BEV/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output. Removed build tracker: '/tmp/pip-req-tracker-pbp_7kuq'

LaCandela commented 9 months ago

I think this is causing the problem:

/Fast-BEV/mmdet3d/ops/ball_query/src/ball_query.cpp:4:10: fatal error: THC/THC.h: No such file or directory 4 | #include <THC/THC.h> | ^~~ compilation terminated. ninja: build stopped: subcommand failed.

I have found a similar issue here:

https://github.com/open-mmlab/mmdetection3d/issues/1332

" olesalscheider commented on Apr 1, 2022

Yes, it seems that the TH/THC include files have been removed in the latest pytorch version. mmdet3d still has to be adjusted to these changes, I guess. "

LaCandela commented 8 months ago

I could set up the repo by using exatly the same mmcv, mmdet, mmseg, mdet3d from sorce as suggested in the install section and using Pytorch v1.10, not higher.