Skip to content

Update VisionClassifierTrainer #48

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ReiiNoki
Copy link

@ReiiNoki ReiiNoki commented Apr 21, 2025

Hello Yanis.

Recently I am taking a Pytorch course in Coursera "Advanced PyTorch Techniques and Applications" and the lecturer used your library for teaching in Module 5 of the course.

When I wrote the code following him I found a fatal problem from your library since it is now currently a beta version.

The problem came from VisionClassifierTrainer.
In the lastest version of library transfomers from huggingface, the class TrainingArguments now changes the keyword "evaluation_strategy" to “eval_strategy” thus your original code didn't work.

I have to change the keyword following the instruction of huggingface/transformers#7974 (comment).

After the change, my training can run but another error came out.

KeyError: "The metric_for_best_model training argument is set to 'eval_accuracy', which is not found in the evaluation metrics. The available evaluation metrics are: ['eval_loss']. Consider changing the metric_for_best_model via the TrainingArguments."

I have to go back to read the code from transformers and found they now only support "loss" as the endword. Thus I changed "accuracy" to "loss" for eval_metrc.

Finally, I can run the training from the course.

Thank you very much for you to work on this easy-to-use library for us to learn Pytorch and deep learning.
I hope my PR could help you to update and maintain it.

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

Successfully merging this pull request may close these issues.

1 participant