AttributeError: module ‘torchtext‘ has no attribute ‘legacy‘

问题:

使用torchtext.data 或者 torchtext.legacy 时报错如下:

bash 复制代码
AttributeError: module 'torchtext' has no attribute 'legacy'

AttributeError: module 'torchtext' has no attribute 'data'

解决办法:

bash 复制代码
pip install torchtext==0.6.0  --no-dependencies
相关推荐
Kyln.Wu1 分钟前
【python实用小脚本-211】[硬件互联] 桌面壁纸×Python梦幻联动|用10行代码实现“开机盲盒”自动化改造实录(建议收藏)
开发语言·python·自动化
Hello.Reader2 分钟前
从零到一上手 Protocol Buffers用 C# 打造可演进的通讯录
java·linux·c#
nmxiaocui13 分钟前
openssl升级
linux·运维·服务器
Ms_Big33 分钟前
ppliteseg改rknn,部署在嵌入式板,加速模型
人工智能·python·深度学习
稻草人想看远方37 分钟前
GC垃圾回收
java·开发语言·jvm
初学者_xuan40 分钟前
零基础快速了解掌握Linux防火墙-Iptables
linux·服务器·防火墙·linux新手小白
胡萝卜的兔1 小时前
go 日志的分装和使用 Zap + lumberjack
开发语言·后端·golang
浪扼飞舟1 小时前
c#基础(一)
开发语言·c#
HetFrame1 小时前
John the Ripper jumbo + HashCat 破解压缩密码 ubuntu amd GPU
linux·ubuntu·amd·密码破解·john·压缩密码·hashcat
折翼的恶魔1 小时前
数据分析:合并
python·数据分析·pandas