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!

4 Likes

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

2 Likes

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)
2 Likes

Hi,
I have tried all the steps mentioned here but still, I couldn’t solve the issue. Any one can help?

1 Like

Hello, to make it work, besides ali92’s summary, I also had to add on top

!pip install -Uq fastcore

Same here. I have tried all the above recommended suggestions by @ali92, but I still get the same error: RuntimeError: Hugging Face hub model specified but package not installed. Run pip install huggingface_hub .

It works for me:

  1. Restart & Clear Cell outputs
  2. Add the cell on the top and exec it first:

!pip install -Uq fastai “timm==0.6.13” huggingface_hub

1 Like