Skip to content
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

您好,debug predict.py的时候出现The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. 请问是怎么回事?如何解决? #6

Open
xuexisuanfa opened this issue May 19, 2023 · 1 comment

Comments

@xuexisuanfa
Copy link

debug predict.py的时候出现The .grad attribute of a Tensor that is not a leaf Tensor is being accessed.
当时mode选的是predict
详情:

D:\Users\li\Anaconda3\envs\yolov7_tiny_obb\python.exe "E:/Program Files/JetBrains/PyCharm 2022.2.2/plugins/python/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 60043 --file E:\yolov7-tiny-obb-master\predict.py
Connected to pydev debugger (build 222.4167.33)
Fusing layers...
logs2/bew.pt model, and classes loaded.
Configurations:

| keys | values|

| model_path | logs2/bew.pt|
| classes_path | model_data/uav_classes.txt|
| anchors_path | model_data/yolo_anchors.txt|
| anchors_mask | [[6, 7, 8], [3, 4, 5], [0, 1, 2]]|
| input_shape | [640, 640]|
| confidence | 0.5|
| nms_iou | 0.3|
| letterbox_image | True|
| cuda | True|

D:\Users\li\Anaconda3\envs\yolov7_tiny_obb\lib\site-packages\torch_tensor.py:1013: 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 aten\src\ATen/core/TensorBody.h:417.)
return self._grad
Input image filename:

@Egrt
Copy link
Owner

Egrt commented May 19, 2023

警告可以忽略

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants