-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
UserWarning: Detected call of lr_scheduler.step()
before optimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.
#283
Comments
@jiyuwangbupt hi I want to know the loss you said is val loss or train loss? EDIT: if it's val loss, then this should be solved in #279 which we'll merge it to main later today. |
@jiyuwangbupt also actually I reproduced the |
I see the same warning running training on coco: |
yolo task=init --config-name helmethyp.yaml --config-path /nfs/volume-622-1/lanzhixiong/project/smoking/code/yolov8/ |
@mehran66 @jiyuwangbupt hey guys, can you try to replace the following line to
|
It still not works for me. I have the same issue as this. And use the datasets, which is directly download from roboflow, his structure have some differences from previous yolo version. |
My env: |
I have the same problem and it still not works |
I have the same problem,but it look like harmless, I don't know what impact it will have,please tell me when you get result |
@GraBerry @Zhu000 this appears sometimes in certain versions of torch, but it's just a warning and you can ignore it. It's not showing up in later versions of torch usually, i.e. you can see our Colab notebook trianing with torch==1.13.1 does not show the warning and torch==2.0.0 doesn't either: |
tried 1.13 , shows the exact same warning. |
@AdamMayor2018 @Zhu000 This warning can be safely ignored as it does not affect the training process. It appears in some older versions of Pytorch, but it is not showing up in later versions like torch==1.13.1 or torch==2.0.0. So, if you have the latest version of Pytorch, you should not see this warning. |
I have the same problem, try this(ultralytics\yolo\cfg\default.yaml amp: False) |
@YIN319 thank you for reporting your issue. The issue you are experiencing is related to the One possible workaround to suppress the warning is to set Please let us know if you have any further questions or concerns. |
+1 same warnings |
@apiszcz thank you for raising this issue. It appears that you are experiencing the However, if the warning is bothersome, one possible workaround is setting Please let us know if you have any further questions or concerns related to this issue, and we will be happy to assist you further. |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Search before asking
YOLOv8 Component
No response
Bug
UserWarning: Detected call of
lr_scheduler.step()
beforeoptimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order:optimizer.step()
beforelr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.class_loss is inf, box_loss is 0, dfl_loss is 0.
By the way, this environment runs fine on yolov5 without warnings. The configuration of the YOLOv8 environment is based on the yolov5 environment, and then use pip install ultralytics (no errors were generated during the period).
Environment
Ultralytics YOLOv8.0.3 🚀 Python-3.8.5 torch-1.11.0+cu102 CUDA:0 (Tesla P40, 12288MiB)
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: