AttributeError: module ‘torchtext.data‘ has no attribute ‘Field‘ 解决
AttributeError: module 'torchtext.data' has no attribute 'Field'
前言
伴随着 3月5日TorchText 0.9.0更新,一些API调用也发生变化
之前我们调用Field,TabularDataset,Iterator,BucketIterator是通过torchtext.data
代码如下(示例):
import torch
import torchtext
from torchtext.data import Field,TabularDataset,Iterator,BucketIterator
在torchtext0.9环境下,会报AttributeError: module ‘torchtext.data’ has no attribute ‘Field’
新的API调用代码如下(示例):
import torch
import torchtext
from torchtext.legacy.data import Field,TabularDataset,Iterator,BucketIterator
官方文档:https://github.com/pytorch/text/releases/tag/v0.9.0-rc5
AttributeError: module ‘torchtext.data‘ has no attribute ‘Field‘ 解决相关推荐
- 解决方法:AttributeError: module ‘torchtext.data‘ has no attribute ‘Field‘
将 from torchtext.data import Field 改为 from torchtext.legacy.data import Field 同理,对于 from torchtext.d ...
- 【Flask】flask-bootstrap报错AttributeError: module ‘dominate.tags‘ has no attribute ‘input‘解决方法
问题 在使用flask-bootstrap渲染表单时,报错AttributeError: module 'dominate.tags' has no attribute 'input'. 解决方法 修 ...
- AttributeError: module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘解决方法
运行一段关于图像拼接的代码时,出现问题 AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' def __init__(sel ...
- module ‘torchtext.data‘ has no attribute ‘LabelField‘
吐槽一句,torchtext比较垃圾,却不知道为啥这么多人用. 言归正传,原因是:torchtext更新了,新版本不这么用了. 解决办法: 将 from torchtext import data 改 ...
- 成功解决AttributeError: module ‘tornado.web‘ has no attribute ‘asynchronous‘
成功解决AttributeError: module 'tornado.web' has no attribute 'asynchronous' 目录 解决问题 解决思路 解决方法 解决问题 Attr ...
- 成功解决AttributeError: module tensorflow.sets has no attribute intersection
成功解决AttributeError: module tensorflow.sets has no attribute intersection 目录 解决问题 解决思路 解决方法 T1.更新 t ...
- 成功解决AttributeError: module tensorflow.image has no attribute resize
成功解决AttributeError: module tensorflow.image has no attribute resize 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
- 成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
- AttributeError: module ‘scipy.signal‘ has no attribute ‘correlation_lags‘
一般这种问题,都是版本号不匹配的问题,通过 pip 更新安装包即可 我原来scipy的版本号是 1.5.2,执行代码 lags = signal.correlation_lags(len(u), le ...
最新文章
- 报名 | 数据科学研究院五周年系列论坛之“人文社科专场
- AWS — AWS 上的 5G 网络切片
- 利刃 MVVMLight 7:命令深入
- Androidstudio如何正确导入和移出jar包
- python批量新建文件夹_python根据txt文本批量创建文件夹
- ssh主机之间建立互信 --免密码
- CodeForces - 1332D Walk on Matrix(构造)
- HRBUST 1909——理工门外的树——————【离线处理,差分前缀和】
- 将Vue+Nodejs项目部署到阿里云服务器
- 秒半价,限四天!Vostro极致轻薄全能本,助你全能全开!
- 日志log4j配置详情,日志log具体到你想不到
- 【Siddhi】Siddhi 4.2.40版本之前的一个Bug
- 深入浅出裸测之道---单元测试的单元化
- Codeforces Round #467 (Div. 2)
- pycharm OpenCV代码补全失效解决方法
- PHP踩坑:对象的引用
- Ajax 重新绑定 webgrid 数据,绑定的WebGrid形式AJAX(Bind WebGrid form AJAX)
- UE4 C++最基础的API
- 分享CFA二级优质复习方法!
- 转载:破解DR.COM实现共享上网方法大搜罗(抱歉,直接转载