-
Notifications
You must be signed in to change notification settings - Fork 26.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
Add image classification script, no trainer #16727
Add image classification script, no trainer #16727
Conversation
The documentation is not available anymore as the PR was closed or merged. |
4fec3dc
to
a5e8caf
Compare
a5e8caf
to
d066098
Compare
@sgugger not sure why, but the test for the script fails:
Weirdly, it passes locally for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice new addition!
Tested locally and had the test pass one time out of 4, so maybe it's a seed issue? Setting a seed made it pass several times in a row. The learning rate seems extremely high for a Transformers model (but maybe ViT exepects that) so I'd say the test is a bit unstable without setting the seed.
examples/pytorch/image-classification/run_image_classification_no_trainer.py
Outdated
Show resolved
Hide resolved
examples/pytorch/image-classification/run_image_classification_no_trainer.py
Outdated
Show resolved
Hide resolved
I'm getting issues when only passing
|
Oh ok, shouldn't be the case. Let's put back the |
* Add first draft * Improve README and run fixup * Make script aligned with other scripts, improve README * Improve script and add test * Remove print statement * Apply suggestions from code review * Add num_labels to make test pass * Improve README
What does this PR do?
This PR adds an example script for image classification that leverages Accelerate instead of the HuggingFace Trainer.
To do:
train_dir
andvalidation_dir
Both can be updated after #16585 is merged.