最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

yolov7报错:报错 For debugging consider passing CUDA_LAUNCH_BLOCKING=1

运维笔记admin3浏览0评论

报错信息

RuntimeError: CUDA error: invalid device ordinal
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

解决方法:
原因:选择GPU设备时torch没有识别到。
解决方法:
加一句torch.cuda.device_count()代码

import torch
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
torch.cuda.device_count()

真的是烦死了,一上午时间,中午也没吃饭,一直在改这个破错误!现在终于跑起来了!!!!!!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论