Windows安装mmdet3d v0.17.1(跑通版)

环境

windows 11家庭版, 64 位操作系统, 基于 x64 的处理器,显卡NVIDIA GeForce RTX 3060
按照本人写的操作步骤在cuda11.1下安装mmdet3d成功后,跑代码报如下错误:

RuntimeError: CUDA error: no kernel image is available for execution on the device

经查阅,可能是cuda版本问题,于是寻求其他版本的安装方式,摸索出如下成功步骤。
注意在这之前需要安装VS2017。

总计在3个地方分别安装了cuda

在conda安装cuda

参考博客《避坑看:最全Pytorch安装、CUDA安装》:https://blog.csdn.net/qq_44113911/article/details/137474925
查看conda可以选择的cuda版本,并选择和mmdet3d v0.17.1适配的一个cuda版本即11.3.1
创建环境管理cuda11.3版本,可自行更改名称cu113和python版本:conda create -n cu113 python=3.8
激活环境:conda activate cu113
安装cuda:conda install cudatoolkit=11.3.1
安装cudnn:conda install cudnn=8.2.1
安装nvcc:conda install -c nvidia cuda-nvcc==11.3.58

pytorch关联cuda安装

pip install torch==1.10.0+cu113 torchvision==0.11.0+cu113 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html

在电脑安装cuda

注意cuda和cudnn要和上面conda中安装的版本完全一致
参考博客:https://blog.csdn.net/zyq880625/article/details/138086225

最后安装mmdet3d

注意上面首步骤已经装完pytorch

pip install mmcv-full==1.4.0
pip install mmdet==2.14.0
pip install mmsegmentation==0.14.1

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

注意

如果mmdet3d最终安装成功,但跑代码报非语法类错误,要重装,必须安装上面的顺序都重新来过,特别是pytorch、mmcv-full、mmdet、mmsegmentation、mmdet3d的顺序不能动。

错误集合

cl: 'cp1' codec can't decode bytes in position 0--1

在安装mmdet3d时出现如上错误,会报出出错的代码,将其中的解码方式从“oem”改为"utf-8",之后参考如下博客操作彻底解决:
https://blog.csdn.net/tanmx219/article/details/100829920
拉到最后,看“办法二”小结,按该方法操作并重启之后就没问题了

ImportError: DLL load failed while importing _ext: 找不到指定的模块

参考:https://blog.csdn.net/qihshe/article/details/136767242
卸载mmcv-full重装即可

TypeError: cannot pickle dict_keys object

如何定位TypeError: cannot pickle dict_keys object错误原因及解决NuScenes数据集在多进程并发训练或测试时出现的这个错误
https://blog.csdn.net/XCCCCZ/article/details/134295931

IndexError: tensors used as indices must be long, byte or bool tensors

这个错误如下语句引发:
assigned_labels[matched_row_inds] = gt_labels[matched_col_inds]
将gt_labels = gt_labels.to(torch.long)增加到上面语句的前面即可消除

got Long for the destination and Int for the source.

这个错误如下语句引发:
labels[pos_inds] = gt_labels[sampling_result.pos_assigned_gt_inds]
这个报错跟上面的问题差不多,同样前面增加gt_labels = gt_labels.to(torch.long)即可

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值