Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert TorchText 0.9 to the latest version #16

Open
zliguo opened this issue Mar 29, 2023 · 10 comments
Open

How to convert TorchText 0.9 to the latest version #16

zliguo opened this issue Mar 29, 2023 · 10 comments

Comments

@zliguo
Copy link

zliguo commented Mar 29, 2023

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?

@LikeGiver
Copy link

LikeGiver commented May 6, 2023

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

@lmw0320
Copy link

lmw0320 commented May 25, 2023

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!

@disdislike
Copy link

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?

@zengchen233
Copy link

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.

@zhangjingxian1998
Copy link

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

@zengchen233
Copy link

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!

@yyyyybb567
Copy link

我使用 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
Copy link

我使用 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
Copy link

我使用 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文件 请问还有其他的办法下载数据或者有下载脚本吗

没解压吧,解压一下

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

@ZZH1010101010
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants