bubbliiiing / yolov7-pytorch

这是一个yolov7的库,可以用于训练自己的数据集。
GNU General Public License v3.0
861 stars 150 forks source link

The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. #42

Closed f1owkang closed 1 year ago

f1owkang commented 1 year ago

C:\Users\presa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\torch_tensor.py:1083: UserWarning: The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. Its .grad attribute won't be populated during autograd.backward(). If you indeed want the .grad field to be populated for a non-leaf Tensor, use .retain_grad() on the non-leaf Tensor. If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. See github.com/pytorch/pytorch/pull/30531 for more informations. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\build\aten\src\ATen/core/TensorBody.h:482.) return self._grad

运行会出现这个警告,不影响正常推理,请问这个怎么可以解决呢? 版本1.12.1+cu116

bubbliiiing commented 1 year ago

忽视就好

f1owkang commented 1 year ago

好的,谢谢