-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一直RuntimeError,但是batchsize已经都设为1了。 #3
Comments
版本呢 |
emmm稀里糊涂错误没了~ |
你好我也出现了类似错误,本地运行可以,但是colab运行报错RuntimeError: result type Float can't be cast to the desired output type long int。是不是pytorch版本问题呢? |
是的 |
将"yolov7-tiny-pytorch/nets/yolo_training.py"中gain = torch.ones(7, device=targets.device)改为gain = torch.ones(7, device=targets.device).long()即可。原因是新版本的torch无法自动执行此转换,旧版本torch可以。若后面接着出现RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)的错误提示,可以借鉴这篇博客,同样是修改yolo_training.py文件 |
现在还有么,好像早改了 |
还有一个result type Float can't be cast to the desired output type __int64错误,请问一下是什么原因呢?
The text was updated successfully, but these errors were encountered: