OpenNMT Forum

_pickle.PicklingError: Can't pickle <function Field.<lambda>: attribute lookup Field.<lambda> on torchtext.data.field failed

opennmt-py

(Vincent Vandeghinste) #1

When I want to preprocess, I get _pickle.PicklingError: Can’t pickle <function Field. at 0x7f7ecf70cb70>: attribute lookup Field. on torchtext.data.field failed.

When I try pip install torchtext, I get requirement already satisfied.
Working in Python 3.6.3.
I just updated my opennmt-py with git pull origin master

Can anyone help me? tx.


(Vincent Nguyen) #2

what version of torchtext do you see installed ? (pip3 list)


(Vincent Vandeghinste) #3

torchtext (0.3.1).
I see that there is a 0.4 version available – should I upgrade ?


(Guillaume Klein) #4

Yes, see the requirements.txt file:


(Vincent Vandeghinste) #5

when I do
pip3 install torchtext==0.4.0

I get

    Collecting torchtext==0.4.0
      Could not find a version that satisfies the requirement torchtext==0.4.0 (from versions: 0.1.1, 0.2.0, 0.2.1, 0.2.3, 0.3.1)
    No matching distribution found for torchtext==0.4.0

I don’t know how to install this.


(Guillaume Klein) #6

The installation instruction is at the top of the README:


(Vincent Vandeghinste) #7

Thanks, everything seems to work again now.