Hugging Face Model Error will not resolve no matter what I try

Hello everyone, I am currently running Jeremy’s notebook Scaling Up: Road to the Top, Part 3. I have made a copy and am running my own version. For some odd reason, whenever I get to the line that says, “train(‘convnext_small_in22k’, 128, epochs=1, accum=1, finetune=False)”, it gives me this error: RuntimeError: Hugging Face hub model specified but package not installed. Run pip install huggingface_hub.

So I followed the instructions and ran “!pip install huggingface_hub” in the kaggle notebook and on my terminal, but it still won’t work. I have searched everywhere for a solution and nothing comes up. Does anyone have a solution that can fix this? This is super frustrating as I am simply trying to learn.

Thank you!


Hi Darren,
Paperspace gave me the same error.
Try upgrading huggingface_hub with the following command:

pip install huggingface_hub -U

In Paperspace, it solved the problem

1 Like

I think the model is part of the timm package. Try checking the starting imports for the Timm package.

Try manually importing by adding !pip install -Uq fastai "timm==0.6.13" huggingface_hub at the top of the notebook and removing the install argument from path = setup_comp(comp, install='fastai "timm>=0.6.2.dev0"')'

1 Like

Thank you @leovand and @Kerner. I was having the same issue on part 2. @leovand’s recommendation solved it. In case it helps listing all steps, this was the precise steps.

  1. Shutting down the session
  2. restarting session
  3. adding !pip install -Uq fastai “timm==0.6.13” huggingface_hub as the first step in the notebook
  4. changing setup_comp(comp, install=‘“fastcore>=1.4.5” “fastai>=2.7.1” “timm>=0.6.2.dev0”’) to setup_comp(comp)
1 Like