HugginFace Hub error

Hi there!

I’m facing an error about HugginFace Hub module when trying to instantiate the learner in the following Kaggle by Jeremy-> First Steps: Road to the Top, Part 1

RuntimeError: Hugging Face hub model specified but package not installed. Run pip install huggingface_hub.

Theres no way to have this working.

I tried updated timm and hagginface_hub with !pip install -Uq for both modules… but the error still occurs when running the cell:
learn = vision_learner(dls, ‘resnet26d’, metrics=error_rate, path=‘.’).to_fp16()

The same error appears if i try other models like “resnet32”

Any suggestion?

Thanks in advance!

I temporally solved it using resnet18:
learn = vision_learner(dls, resnet18, metrics=error_rate, path=‘.’)

but still would like to know what is the problem

I fixed it, you can try to restart the kernel and then run :
!pip install -Uq huggingface_hub
before running any other instructions.

Noticed the same issue was faced elsewhere, where !pip install timm needs to be run at the start : NameError: name 'timm' is not defined

1 Like

I faced the same error for Road to Top Part 3. Switching the environment from “Pin to Original Envrionment” to “Always use latest environment” worked

Thanks that worked for me!

!pip install -Uq fastai
!pip install -Uq fastcore
!pip install huggingface_hub -U

Running this cleared my problem