"Hugging Face hub model specified but package not installed" Lesson 6 Road to Top Part1

When working though this notebook:



learn = vision_learner(dls, ‘resnet26d’, metrics=error_rate, path=‘.’).to_fp16()

I’m getting the following error:

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

However when I run pip install huggingface_hub I get a message that the requirement is already satisfied.

Requirement already satisfied: huggingface_hub in /opt/conda/lib/python3.7/site-packages (0.5.1)

This forum post provides a solution which is to change the following line in the notebook (seems like a version issue with timm):

path = setup_comp(comp, install='fastai "timm>=0.6.2.dev0"')


path = setup_comp(comp, install='fastai "timm==0.6.2.dev0"')

I just tested it out and was able to load and train the model with that change:



1 Like

I had to first uninstall huggingface_hub and then reinstall it after making the change above.

From the Kaggle console:

> pip uninstall huggingface_hub
Found existing installation: huggingface-hub 0.5.1
Uninstalling huggingface-hub-0.5.1:
  Would remove:
Proceed (Y/n)? 
> Y
> pip install huggingface_hub