[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

好了顺利解决。

相关推荐
phantom_1112 天前
Cursor 分析 bug 记录
bug·cursor
Direction_Wind3 天前
Flinksql bug: Heartbeat of TaskManager with id container_XXX timed out.
大数据·flink·bug
AIBigModel6 天前
智能情趣设备、爆 bug:可被远程操控。。。
网络·安全·bug
Direction_Wind6 天前
flinksql bug: Received resultset tuples, but no field str
bug
远瞻。6 天前
【bug】diff-gaussian-rasterization Windows下编译 bug 解决
windows·bug
中草药z6 天前
【测试】Bug+设计测试用例
功能测试·测试工具·测试用例·bug·压力测试·测试
我又来搬代码了7 天前
【Android】【bug】Json解析错误Expected BEGIN_OBJECT but was STRING...
android·json·bug
葵野寺7 天前
【软件测试】BUG篇 — 详解
bug·测试
青青子衿越9 天前
微信小程序右上角分享页面找不到路径bug
微信小程序·小程序·bug
刘火锅10 天前
Bug 记录:SecureRandom.getInstanceStrong()导致验证码获取阻塞
spring boot·spring·spring cloud·bug