对着这个来,绝对成功:
这个不需要安装vs,我前面安装vs啥的那一套还是不行……
Windows 10 mmcv-full 1.3.13 安装记录
需要注意:如果其他环境都有了,那就直接下载,mmcv的工程,然后用python编译就可以,编译完成后直接使用pip list查看安装了没有,作者提到的show方式我没有运行成功。
这是安装成功后的照片:
用这段代码测试一下,不报错就是没问题:
import numpy as np
import torch
from mmcv.ops import box_iou_rotated
def check_installation():
"""Check whether mmcv-full has been installed successfully."""
np_boxes1 = np.asarray(
[[1.0, 1.0, 3.0, 4.0, 0.5], [2.0, 2.0, 3.0, 4.0, 0.6],
[7.0, 7.0, 8.0, 8.0, 0.4]],
dtype=np.float32)
np_boxes2 = np.asarray(
[[0.0, 2.0, 2.0, 5.0, 0.3], [2.0, 1.0, 3.0, 3.0, 0.5],
[5.0, 5.0, 6.0, 7.0, 0.4]],
dtype=np.float32)
boxes1 = torch.from_numpy(np_boxes1)
boxes2 = torch.from_numpy(np_boxes2)
# test mmcv-full with CPU ops
box_iou_rotated(boxes1, boxes2)
# test mmcv-full with both CPU and CUDA ops
if torch.cuda.is_available():
boxes1 = boxes1.cuda()
boxes2 = boxes2.cuda()
box_iou_rotated(boxes1, boxes2)
if __name__ == '__main__':
check_installation()
哈哈哈,不行又报错了!!!意外不~
打开这个github:
https://github.com/open-mmlab/mmcv/blob/master/README_zh-CN.md
我的cuda是11.1,torch是1.9的,直接用了这句指令就安装好了。
这是好了的截图: