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

报错信息 RuntimeError: CUDA error: invalid device ordinalCUDA kernel errors might be asynchronously reported at some other

报错信息

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()

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

发布者:admin,转转请注明出处:http://www.yc00.com/web/1738332666a4038274.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信