(MIT)BEVFusion 部署遇到的问题

BEVfusion部署遇到的问题

不知道大家有没有遇到过这个问题,希望可以讨论一下解决方案

想要部署BEVFusion,参照博客地址:BEVFusion(mit)最强环境安装,部署复现_h i i l的博客-CSDN博客 进行环境搭建

我的环境 ubuntu 22.04

cuda 11.8

python=3.8

pytorch 2.0.1

gcc / g++ -11

在进行编译的时候遇见了常见的THC的报错,根据复现BEVDet_吴晓Q的博客-CSDN博客这篇博文删除了脚本中的THC,该问题得到解决

但是在编译的时候依然报错:

FAILED: /home/dl/csl/bevfusion/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/ball_query/src/ball_query.o
c++ -MMD -MF /home/dl/csl/bevfusion/build/temp.linux-x86_64-cpython-38/mmdet3d/ops/ball_query/src/ball_query.o.d -pthread -B /home/dl/anaconda3/envs/bevfusion/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/dl/anaconda3/envs/bevfusion/include -fPIC -O2 -isystem /home/dl/anaconda3/envs/bevfusion/include -fPIC -DWITH_CUDA -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/TH -I/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/dl/anaconda3/envs/bevfusion/include/python3.8 -c -c /home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp -o /home/dl/csl/bevfusion/build/temp.linux-x86_64-cpython-38/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
In file included from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/core/DeviceType.h:8,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/core/Device.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:11,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
                 from /home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:7:
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp: In function ‘int ball_query_wrapper(int, int, int, float, float, int, at::Tensor, at::Tensor, at::Tensor)’:
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:15:21: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
   15 |   TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
      |                     ^
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/macros/Macros.h:200:64: note: in definition of macro ‘C10_UNLIKELY’
  200 | #define C10_UNLIKELY(expr) (__builtin_expect(static_cast<bool>(expr), 0))
      |                                                                ^~~~
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/util/Exception.h:506:7: note: in expansion of macro ‘C10_UNLIKELY_OR_CONST’
  506 |   if (C10_UNLIKELY_OR_CONST(!(cond))) {            \
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:15:3: note: in expansion of macro ‘TORCH_CHECK’
   15 |   TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
      |   ^~~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:19:3: note: in expansion of macro ‘CHECK_CUDA’
   19 |   CHECK_CUDA(x);       \
      |   ^~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:33:3: note: in expansion of macro ‘CHECK_INPUT’
   33 |   CHECK_INPUT(new_xyz_tensor);
      |   ^~~~~~~~~~~
In file included from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
                 from /home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:7:
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:222:30: note: declared here
  222 |   DeprecatedTypeProperties & type() const {
      |                              ^~~~
In file included from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/core/DeviceType.h:8,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/core/Device.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:11,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
                 from /home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:7:
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:15:21: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
   15 |   TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
      |                     ^
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/macros/Macros.h:200:64: note: in definition of macro ‘C10_UNLIKELY’
  200 | #define C10_UNLIKELY(expr) (__builtin_expect(static_cast<bool>(expr), 0))
      |                                                                ^~~~
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/c10/util/Exception.h:506:7: note: in expansion of macro ‘C10_UNLIKELY_OR_CONST’
  506 |   if (C10_UNLIKELY_OR_CONST(!(cond))) {            \
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:15:3: note: in expansion of macro ‘TORCH_CHECK’
   15 |   TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
      |   ^~~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:19:3: note: in expansion of macro ‘CHECK_CUDA’
   19 |   CHECK_CUDA(x);       \
      |   ^~~~~~~~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:34:3: note: in expansion of macro ‘CHECK_INPUT’
   34 |   CHECK_INPUT(xyz_tensor);
      |   ^~~~~~~~~~~
In file included from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                 from /home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
                 from /home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:7:
/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:222:30: note: declared here
  222 |   DeprecatedTypeProperties & type() const {
      |                              ^~~~
/home/dl/csl/bevfusion/mmdet3d/ops/ball_query/src/ball_query.cpp:39:35: error: ‘getCurrentCUDAStream’ is not a member of ‘at::cuda’
   39 |   cudaStream_t stream = at::cuda::getCurrentCUDAStream().stream();
      |                                   ^~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
    subprocess.run(
  File "/home/dl/anaconda3/envs/bevfusion/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 42, in <module>
    setup(
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/command/develop.py", line 111, in install_for_development
    self.run_command('build_ext')
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
    build_ext.build_extensions(self)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
    self._build_extensions_serial()
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
    objects = self.compiler.compile(
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/dl/anaconda3/envs/bevfusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值