Record the cuda error that occurs when configuring mmpose RuntimeError: CUDA error: invalid device function

Record the cuda error that occurs when mmpose is configured

Configure mmpose in the Ubuntu environment, according to the install.md file configuration under the mmpose project, create a virtual environment,

1、conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

2. Install pytorch1.5, cudatoolkit10.1 and cudadnn7.6

3. To install mmcv-full, use the command pip install mmcv-full directly

4. Download mmpose source code
git clone [email protected]:open-mmlab/mmpose.git
cd mmpose

5、pip install -r requirements.txt
python setup.py develop

The operation is as fierce as a tiger. After finishing the configuration environment, run the demo code.

python demo/top_down_video_demo_with_mmdet.py \
    demo/mmdetection_cfg/faster_rcnn_r50_fpn_1x_coco.py \
    http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
    configs/top_down/hrnet/coco/hrnet_w48_coco_256x192.py \
    https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
    --video-path demo/demo.mp4 \
    --out-video-root vis_results

program error

RuntimeError: CUDA error: invalid device function

I searched a lot on the Internet, and most people said that the cuda version and pytorch version were wrong, which caused this error. After many attempts, I found that the mmcv-full library was at fault. Solution:
uninstall mmcv-full
pip uninstall mmcv-full

Then reinstall mmcv-full: pip
install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.5.0/index.html The bold part is set according
to your own configuration environment, so After operation, the problem is solved.

Ich denke du magst

Origin blog.csdn.net/weixin_42280271/article/details/114581249
Empfohlen
Rangfolge