transformer icon indicating copy to clipboard operation
transformer copied to clipboard

How to convert TorchText 0.9 to the latest version

Open zliguo opened this issue 1 year ago • 10 comments

I'm new to transformer recently ,and I know there is official documentation, but it doesn't fix the problem. Can someone help me change torchtext 0.9 to the new version?

zliguo avatar Mar 29 '23 08:03 zliguo

i used conda to install torchtext, and it seems that it recommends torchtext==0.6.0, Screenshot from 2023-05-06 20-22-20 then you actually don't need to change anything but the two lines in util/data_loader(line 6, 7) Screenshot from 2023-05-06 20-18-41 and it works well! Screenshot from 2023-05-06 20-20-37

LikeGiver avatar May 06 '23 12:05 LikeGiver

i used conda to install torchtext, and it seems that it recommends torchtext==0.6.0, Screenshot from 2023-05-06 20-22-20 then you actually don't need to change anything but the two lines in util/data_loader(line 6, 7) Screenshot from 2023-05-06 20-18-41 and it works well! Screenshot from 2023-05-06 20-20-37

Hei, bro, could you pls tell me how to download the datasets, thanks in advance!

lmw0320 avatar May 25 '23 12:05 lmw0320

I‘m new to transformer rencently,too. My torchtext==0.15, the fuction Field and Bucketerator were removed . What are the alternatives to torchtext.field and Buckerator?

disdislike avatar Oct 23 '23 13:10 disdislike

i used conda to install torchtext, and it seems that it recommends torchtext==0.6.0, Screenshot from 2023-05-06 20-22-20 then you actually don't need to change anything but the two lines in util/data_loader(line 6, 7) Screenshot from 2023-05-06 20-18-41 and it works well! Screenshot from 2023-05-06 20-20-37

Hello, my friend, can you give me a copy of your requirements.txt? I would be very grateful.

zengchen233 avatar Nov 03 '23 02:11 zengchen233

i used conda to install torchtext, and it seems that it recommends torchtext==0.6.0, Screenshot from 2023-05-06 20-22-20 then you actually don't need to change anything but the two lines in util/data_loader(line 6, 7) Screenshot from 2023-05-06 20-18-41 and it works well! Screenshot from 2023-05-06 20-20-37

Hello, my friend, can you give me a copy of your requirements.txt? I would be very grateful.

python3.8 torch==1.7 torchvison==0.8.1 torchtext==0.8.0

replace the

from torchtext.legacy.data import Field, BucketIterator
from torchtext.legacy.datasets import Multi30k

by

from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k

if the data can't dowload, you can download them from

https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/training.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/validation.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/mmt16_task1_test.tar.gz'

and tar them in the .data/multi30k folder

zhangjingxian1998 avatar Nov 08 '23 05:11 zhangjingxian1998

i used conda to install torchtext, and it seems that it recommends torchtext==0.6.0, Screenshot from 2023-05-06 20-22-20 then you actually don't need to change anything but the two lines in util/data_loader(line 6, 7) Screenshot from 2023-05-06 20-18-41 and it works well! Screenshot from 2023-05-06 20-20-37

Hello, my friend, can you give me a copy of your requirements.txt? I would be very grateful.

python3.8 torch==1.7 torchvison==0.8.1 torchtext==0.8.0

replace the

from torchtext.legacy.data import Field, BucketIterator
from torchtext.legacy.datasets import Multi30k

by

from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k

if the data can't dowload, you can download them from

https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/training.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/validation.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/mmt16_task1_test.tar.gz'

and tar them in the .data/multi30k folder

okay, thank u, my friends!

zengchen233 avatar Nov 12 '23 03:11 zengchen233

我使用 conda 安装 torchtext,似乎它推荐 torchtext==0.6.0,那么您实际上不需要更改任何东西,只需更改 util/data_loader(第 6、7 行)Screenshot from 2023-05-06 20-18-41中的两行,Screenshot from 2023-05-06 20-22-20效果很好!Screenshot from 2023-05-06 20-20-37

你好,我的朋友,你能给我一份你的要求.txt吗?我将不胜感激。

python3.8 火炬==1.7 火炬视子==0.8.1 火炬文本==0.8.0

from torchtext.legacy.data import Field, BucketIterator
from torchtext.legacy.datasets import Multi30k

from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k

如果数据无法下载,您可以从

https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/training.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/validation.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/mmt16_task1_test.tar.gz'

并将它们涂在 .data/multi30k 文件夹中

您好 我按照您后面的方法 将三个文件下载并放到文件夹.data/multi30k 中,但是依然提示缺少train.en文件 请问还有其他的办法下载数据或者有下载脚本吗

yyyyybb567 avatar Dec 13 '23 06:12 yyyyybb567

我使用 conda 安装 torchtext,似乎它推荐 torchtext==0.6.0,那么您实际上不需要更改任何东西,只需更改 util/data_loader(第 6、7 行)Screenshot from 2023-05-06 20-18-41中的两行,Screenshot from 2023-05-06 20-22-20效果很好!Screenshot from 2023-05-06 20-20-37

你好,我的朋友,你能给我一份你的要求.txt吗?我将不胜感激。

python3.8 火炬==1.7 火炬视子==0.8.1 火炬文本==0.8.0 将

from torchtext.legacy.data import Field, BucketIterator
from torchtext.legacy.datasets import Multi30k

from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k

如果数据无法下载,您可以从

https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/training.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/validation.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/mmt16_task1_test.tar.gz'

并将它们涂在 .data/multi30k 文件夹中

您好 我按照您后面的方法 将三个文件下载并放到文件夹.data/multi30k 中,但是依然提示缺少train.en文件 请问还有其他的办法下载数据或者有下载脚本吗

没解压吧,解压一下

zhangjingxian1998 avatar Dec 13 '23 06:12 zhangjingxian1998

我使用 conda 安装 torchtext,似乎它推荐 torchtext==0.6.0,那么您实际上不需要更改任何东西,只需更改 util/data_loader(第 6、7 行)Screenshot from 2023-05-06 20-18-41中的两行,Screenshot from 2023-05-06 20-22-20效果很好!Screenshot from 2023-05-06 20-20-37

你好,我的朋友,你能给我一份你的要求.txt吗?我将不胜感激。

python3.8 火炬==1.7 火炬视子==0.8.1 火炬文本==0.8.0 将

from torchtext.legacy.data import Field, BucketIterator
from torchtext.legacy.datasets import Multi30k

from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k

如果数据无法下载,您可以从

https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/training.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/validation.tar.gz'
https://raw.githubusercontent.com/neychev/small_DL_repo/master/datasets/Multi30k/mmt16_task1_test.tar.gz'

并将它们涂在 .data/multi30k 文件夹中

您好 我按照您后面的方法 将三个文件下载并放到文件夹.data/multi30k 中,但是依然提示缺少train.en文件 请问还有其他的办法下载数据或者有下载脚本吗

没解压吧,解压一下

解决了我的问题,非常感谢!!!

yyyyybb567 avatar Dec 13 '23 08:12 yyyyybb567

I‘m new to transformer rencently,too. My torchtext==0.15, the fuction Field and Bucketerator were removed . What are the alternatives to torchtext.field and Buckerator?我最近也是变压器新手。我的torchtext==0.15,功能Field和Bucketerator被删除了。 torchtext.field 和 Buckerator 的替代品有哪些?

I have this problem,too.Do you solve this problem?

ZZH1010101010 avatar Jan 11 '24 14:01 ZZH1010101010