ENSTA-U2IS-AI / torch-uncertainty

Open-source framework for uncertainty and deep learning models in PyTorch :seedling:
https://torch-uncertainty.github.io
Apache License 2.0
307 stars 20 forks source link

:bug: ModuleNotFoundError: No module named 'huggingface_hub.errors' #121

Closed xingluzheshuai closed 1 week ago

xingluzheshuai commented 2 weeks ago
  1. I want to use my own dataset to train and test a DER model,how should i do?
  2. I use the DEC python file in\torch-uncertainty-main\auto_tutorials_source\tutorial_evidential_classification.py

How to solve this problem? here's the problem:

Traceback (most recent call last):
  File "D:\wxh\torch-uncertainty-main\torch-uncertainty-main\auto_tutorials_source\tutorial_evidential_classification.py", line 33, in <module>
    from torch_uncertainty import TUTrainer
  File "D:\wxh\torch-uncertainty-main\torch-uncertainty-main\torch_uncertainty\__init__.py", line 2, in <module>
    from .utils import TULightningCLI, TUTrainer
  File "D:\wxh\torch-uncertainty-main\torch-uncertainty-main\torch_uncertainty\utils\__init__.py", line 4, in <module>
    from .hub import load_hf
  File "D:\wxh\torch-uncertainty-main\torch-uncertainty-main\torch_uncertainty\utils\hub.py", line 6, in <module>
    from huggingface_hub.errors import EntryNotFoundError
ModuleNotFoundError: No module named 'huggingface_hub.errors'

We do the pip list in virtual environment, the version of huggingface_hub is 0.20.1

o-laurent commented 2 weeks ago

Hello @xingluzheshuai,

Updating the huggingface_hub library (the current version is 0.26.2) should solve the problem. This dependency is in pre-release, and they just changed the location of the error in their library, hence the bug.

For DER, you can have a look at this tutorial: https://torch-uncertainty.github.io/auto_tutorials/tutorial_der_cubic.html#sphx-glr-auto-tutorials-tutorial-der-cubic-py

Let us know if you have problems with DER and have a great day!