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

Image Classification Guide Missing Dependency and Addition for Local Models #30059

Closed
1 of 4 tasks
Tanman2001 opened this issue Apr 4, 2024 · 1 comment · Fixed by #30820
Closed
1 of 4 tasks

Image Classification Guide Missing Dependency and Addition for Local Models #30059

Tanman2001 opened this issue Apr 4, 2024 · 1 comment · Fixed by #30820

Comments

@Tanman2001
Copy link

System Info

  • transformers version: 4.39.2
  • Platform: Windows-10-10.0.22631-SP0
  • Python version: 3.11.1
  • Huggingface_hub version: 0.22.1
  • Safetensors version: 0.4.2
  • Accelerate version: 0.28.0
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.2.2+cu118 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Tested using PyTorch only.

  • Missing pip install scikit-learn
  1. Follow Image Classification guide here: https://huggingface.co/docs/transformers/tasks/image_classification
  2. Warning on accuracy = evaluate.load("accuracy") saying scikit-learn is missing.
  3. Later training crashes due to missing module.

Additional recommendation:

Users should be able to use their model for inference even when they are unable to or it is not preferable for the user to push their model to the hub.

Add to guide under inference, in the pipelining section:
classifier = pipeline("image-classification", model="<path of checkpoint folder>")
as an option to use a locally stored checkpoint of their model for inference.

Expected behavior

Following guide as written should not result in crash.

Additionally, users should know how to use the model when it is saved locally (as checkpointing automatically does).

@ArthurZucker
Copy link
Collaborator

Very related to #30058

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

Successfully merging a pull request may close this issue.

3 participants