[Bug] Error: cannot import name ‘ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST‘

code

复制代码
BRANCH = 'r1.23.0'

!python -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[all]

# Ignore pre-production warnings

import warnings

warnings.filterwarnings('ignore')

import nemo

# Import Speech Recognition collection

import nemo.collections.asr as nemo_asr

# Import Natural Language Processing collection

import nemo.collections.nlp as nemo_nlp

# Import Speech Synthesis collection

import nemo.collections.tts as nemo_tts

# We'll use this to listen to audio

import IPython

出现下面的错误

复制代码
---------------------------------------------------------------------------
复制代码
ImportError                               Traceback (most recent call last)
复制代码
<ipython-input-16-57327be21084> in <cell line: 8>()
      6 import nemo.collections.asr as nemo_asr
      7 # Import Natural Language Processing collection
----> 8 import nemo.collections.nlp as nemo_nlp
      9 # Import Speech Synthesis collection
     10 import nemo.collections.tts as nemo_tts

ImportError: cannot import name 'ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py)

/usr/local/lib/python3.10/dist-packages/nemo/collections/nlp/modules/common/huggingface/huggingface_utils.py in <module> 16 from typing import List, Optional 17 ---> 18 from transformers import ( 19 ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, 20 BERT_PRETRAINED_MODEL_ARCHIVE_LIST,

分析和解决

import nemo.collections.nlp as nemo_nlp

这一步有问题,但是根本原因还是 transformers 版本有点问题,找到对应的版本即可。

所以重新安装一下下面版本的transformers

!pip uninstall transformers

!pip install transformers==4.36.0

好了顺利解决。

相关推荐
hello_2503 天前
bug排查思路大纲
bug
秃头小饼干3 天前
关于Bug排查日记的技术文章大纲
bug
烧冻鸡翅QAQ3 天前
测试中的Bug
bug·测试
云和数据.ChenGuang5 天前
java常见SSL bug解决方案
java·bug·ssl
cat_with_cat5 天前
测试:BUG篇
bug·测试
黑客飓风5 天前
Bug排查日记的技术
bug
Wiktok6 天前
[Wit]CnOCR模型训练全流程简化记录(包括排除BUG)
python·深度学习·bug
玄尺_0076 天前
bug:uniCloud报Business Failed, 参数有误retry invoke error
数据库·bug
程序猿阿伟6 天前
《云原生边缘与AI训练场景:2类高频隐蔽Bug的深度排查与架构修复》
人工智能·云原生·bug
夕阳UPdz6 天前
深入探索 Unity 错误排查过程:从“滚动条问题”到“鼠标悬浮异常”
bug