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

When working though this notebook:

https://www.kaggle.com/code/jhoward/first-steps-road-to-the-top-part-1

line:

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"')

to

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:

3 Likes

Thanks

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:
    /opt/conda/bin/huggingface-cli
    /opt/conda/lib/python3.7/site-packages/huggingface_hub-0.5.1.dist-info/*
    /opt/conda/lib/python3.7/site-packages/huggingface_hub/*
Proceed (Y/n)? 
> Y
> pip install huggingface_hub