google-colaboratory - 无法使用 colaboratory 在 mmdetection 中编译 nms_cuda
问题描述
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/TensorBody.h:262: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:4:23: note: in definition of macro ‘CHECK_CUDA’
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
^~~~~~~~
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:4:23: note: in definition of macro ‘CHECK_CUDA’
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
^~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
现在我得到的所有信息:
- 系统版本 8.2
- /usr/bin/gcc 7
- gcc 版本 7.5
正常吗?发生了什么?库达错误?gcc 错误?怎么解决。我急着用它来运行 mmdetection 程序。
解决方案
解决方案是:
conda install pytorch cudatoolkit==10.0 torchvision -c pytorch -y
如果使用早于 v2.0.0 的分支。
或者:
conda install pytorch cudatoolkit torchvision -c pytorch -y
如果分支等于 v2.0.0。
我花了 3 天时间才弄清楚这一点。基本上,如果您安装 cudatoolkit==10.0,这将强制 pytorch 降级到 pytorch 1.4 版,从而使整个工作正常。它一点也不明显。在我看来,这是 mmdetection 安装指南中的一个错误。
推荐阅读
- azure - Azure 负载均衡器使用区域 1,因为订阅 xxx-xxx-xxx-xxx 不支持位置 westus 中的区域 1
- matlab - 虚部为 0 的 FFT bin
- python - 如何使用 lmfit Python 绘制多个实验数据的高斯拟合
- python - 使用列表理解的函数仅返回 1 个元素...?
- python - 多处理 - 迭代循环浏览文件夹中的文件
- c# - 无法使用 gRPCUI 加载依赖的 .proto 文件
- c++ - opencv::pointPolygonTest 背后的算法是什么?
- python - 如何使用fuzzywuzzy从列表中提取全文?
- discord.py - 有要求的不和谐赠品机器人
- jpa - 如何使用 JPA 调用使用 MySQL 中的多个表的简单选择过程