FutureWarning: torch.cuda.amp.autocast(args...)
is deprecated. Please use torch.amp.autocast('cuda', args...)
instead. with amp.autocast(autocast):
你好。我检查了模型 dtype,然后使用「with torch.autocast(“cuda”, torch.float32):」而不是「with torch.cuda.amp.autocast(autocast):」,它起作用了,并且没有未来警告,仅供参考。
pstorch.版本== 2.4.1 ,yolov5 模型