UserWarning: adaptive_avg_pool2d_backward_cuda does not have a deterministic implementation, but you set 'torch.use_deterministic_algorithms(True, warn_only=True)'. You can file an issue at https://github.com/pytorch/pytorch/issues to help us prioritize adding deterministic support for this operation. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\Context.cpp:75.) Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
在训练yolov10的时候,打印训练结果的时候,旁边出现这个警告的话。
解决方法:ultralytics/engine/trainer.py找到这个trainer.py,使用ctrl+F,输入 Backward
在他的上一行加入这行代码即可。
# 训练的时候不报警告
torch.use_deterministic_algorithms(False)