text icon indicating copy to clipboard operation
text copied to clipboard

Torchtext.data.Field import error

Open premiitr opened this issue 2 years ago • 2 comments

I'm trying to import field module from torchtext 0.15.2 version But it is throwing "AttributeError: module 'torchtext.data' has no attribute 'Field'" Like this

Can anyone help me with this issue?

Thanks in Advance

premiitr avatar Aug 16 '23 11:08 premiitr

'Field' was moved to torchtext.legacy since torchtext 0.9.0 release and legacy retired from torchtext==0.12.0 onwards. Refer here https://github.com/pytorch/text/issues/664

bhavyashahh avatar Aug 16 '23 23:08 bhavyashahh

@premiitr Field is deprecated. You can check one of my repo for the updated version of torchtext. Link: https://github.com/Kousik-Sasmal/experiment-with-pytorch-torchtext

Kousik-Sasmal avatar Aug 20 '23 06:08 Kousik-Sasmal