版本
- pytorch=1.12.0=py3.9_cuda11.6_cudnn8.3.2_0
- pytorch-mutex=1.0=cuda
- torchaudio=0.12.0=py39_cu116
- torchvision=0.13.0=py39_cu116
报错
build target indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices runtimeerror: result type float can't be cast to the desired output type long int
解决方案
在loss.py文件下修改
gain = torch.ones(7, device = device)
替换为
gain = torch.ones(7, device = device).long()