ImportError: cannot import name ‘model_info‘ from ‘huggingface_hub‘

Traceback (most recent call last):
  File "D:/zjm-project/zjm/CaliNet-master/train_calinet/run_kb_t5_freeze.py", line 50, in
    from src.trainer_seq2seq import Seq2SeqTrainer
  File "D:\zjm-project\zjm\CaliNet-master\src\trainer_seq2seq.py", line 26, in
    from .trainer import Trainer
  File "D:\zjm-project\zjm\CaliNet-master\src\trainer.py", line 75, in
    from transformers.modelcard import TrainingSummary
  File "D:\ANACONDA\envs\pytorch\lib\site-packages\transformers\modelcard.py", line 28, in
    from huggingface_hub import model_info
ImportError: cannot import name 'model_info' from 'huggingface_hub' (D:\ANACONDA\envs\pytorch\lib\site-packages\huggingface_hub\__init__.py)

解决方法:

报错的这句改成:

from huggingface_hub import HfApi

你可能感兴趣的:(python,pytorch,深度学习)