-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
Apex.amp.initialize: lr_scheduler.LambdaLR AttributeError: 'function' object has no attribute '__self__' #574
Comments
Hello @Zepyhrus, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com. |
There is a PR open for pytorch 1.6. native amp. You can use this branch or simply wait a few days for it to get merged with origin/master. See #573 |
Hi glenn, thanks for replying. The problem is, this issue persists when I switch back to Pytorch 1.5.1. |
it appears you may have environment problems. Please ensure you meet all dependency requirements if you are attempting to run YOLOv5 locally. If in doubt, create a new virtual Python 3.8 environment, clone the latest repo (code changes daily), and RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🐛 Bug
During training with mixed precision, scheduler initialized failed with
AttributeError: 'function' object has no attribute '__self__'
.To Reproduce (REQUIRED)
Input:
Output:
Expected behavior
Scheduler initialized successfully.
Environment
If applicable, add screenshots to help explain your problem.
Additional context
Following this exactly the same problem in yolov3, I have reinstall pytorch/apex pefectly, but problem persists.
The interesting thing is: when I set
model, optimizer = amp.initialize(model, optimizer, opt_level='O1', verbosity=0)
theopt_level
option toO2
orO0
, problem solved, but the training loss will yield infinite in several steps.If I disable
mixed_precision
, training problem totally solved, hope this will provide some cues for debugging.The text was updated successfully, but these errors were encountered: