运行solov2代码时google colab中的bug

2024-06-16 13:58:59 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我正在尝试执行代码: https://github.com/universea/SOLOv2 在google colab中 但是,在运行时对环境的安装进行监视: 我剪掉了密码,否则我就不能发布了

!python setup.py install 

我弄错了

 
mmdet/ops/nms/src/nms_cuda.cpp: In function ‘at::Tensor nms(const at::Tensor&, float)’:
mmdet/ops/nms/src/nms_cuda.cpp:4:39: 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]
 #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
                                       ^
mmdet/ops/nms/src/nms_cuda.cpp:9:3: note: in expansion of macro ‘CHECK_CUDA’
   CHECK_CUDA(dets);
   ^~~~~~~~~~
In file included from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/Tensor.h:3:0,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/Context.h:4,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/ATen.h:9,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /usr/local/lib/python3.6/dist-packages/torch/include/torch/extension.h:4,
                 from mmdet/ops/nms/src/nms_cuda.cpp:2:
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/TensorBody.h:277:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^~~~
mmdet/ops/nms/src/nms_cuda.cpp:4:23: error: ‘AT_CHECK’ was not declared in this scope
 #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
                       ^
mmdet/ops/nms/src/nms_cuda.cpp:9:3: note: in expansion of macro ‘CHECK_CUDA’
   CHECK_CUDA(dets);
   ^~~~~~~~~~
mmdet/ops/nms/src/nms_cuda.cpp:4:23: note: suggested alternative: ‘DCHECK’
 #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
                       ^
mmdet/ops/nms/src/nms_cuda.cpp:9:3: note: in expansion of macro ‘CHECK_CUDA’
   CHECK_CUDA(dets);
   ^~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

请帮帮我 非常感谢。 致意


Tags: fromincludelibpackagesusrlocaldistcheck