windows安装mmaction2环境踩坑

1.安装mmcv报错:

OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
解决方法:安装cuda

装完后之前那个错误没有了,出现新错误:
distutils.errors.DistutilsError: Command ‘[‘C:\Users\Lux\.conda\envs\py36\python.exe’, ‘-m’, ‘pip’, ‘–disable-pip-version-check’, ‘wheel’, ‘–no-deps’, ‘-w’, ‘C:\Users\Lux\AppData\Local\Temp\tmpmkpp5rsh’, ‘–quiet’, ‘pytest-runner’]’ returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

参考这个博客
查看错误报告发现根源是这一句:
ERROR: Could not find a version that satisfies the requirement pytest-runner
ERROR: No matching distribution found for pytest-runner

就是说找不到这个库的对应版本,解决方法是直接pip安装这个库,然后再装mmcv,成功。

装完后可以跑mmaction2的测试代码看看

import torch
from mmaction.apis import init_recognizer, inference_recognizer

config_file = 'configs/recognition/tsn/tsn_r50_video_inference_1x1x3_100e_kinetics400_rgb.py'
device = 'cuda:0' # or 'cpu'
device = torch.device(device)

model = init_recognizer(config_file, device=device)

#inference the demo video
result = inference_recognizer(model, 'demo/demo.mp4', 'demo/label_map.txt')
print(result)

后面我又尝试pip安装mmcv-full,报一堆错,放弃,看来目前只能下源码自己编译。可以看官方的教程:知乎链接

你可能感兴趣的:(计算机视觉,python,mmaction,mmcv,windows)