Unbabel / OpenKiwi

Open-Source Machine Translation Quality Estimation in PyTorch
https://unbabel.github.io/OpenKiwi/
GNU Affero General Public License v3.0
228 stars 48 forks source link

PicklingError: Can't pickle <class 'kiwi.data.encoders.wmt_qe_data_encoder.InputFields[PositiveInt]'>: attribute lookup InputFields[PositiveInt] on kiwi.data.encoders.wmt_qe_data_encoder failed #110

Open Blinkblade opened 2 years ago

Blinkblade commented 2 years ago

Describe the bug In Windows10,when I try to train_from_file in my Jupyter,I will fail in "Validation sanity check" and the erro is PicklingError:"Can't pickle <class 'kiwi.data.encoders.wmt_qe_data_encoder.InputFields[PositiveInt]'>: attribute lookup InputFields[PositiveInt] on kiwi.data.encoders.wmt_qe_data_encoder failed". But when I run it in Linux with the same files,it will be all right with no error.

To Reproduce Steps to reproduce the behavior: 1.My code in Jupyter: from kiwi.lib.train import train_from_file import pathlib congfig = pathlib.Path("config/bert.yaml") run_info = train_from_file(congfig)

2.my bert.yaml: bert.yaml.txt

3.Then it will load model and data,until it begin to "Validation sanity check",there will be this PicklingError.

Expected behavior PicklingError: Can't pickle <class 'kiwi.data.encoders.wmt_qe_data_encoder.InputFields[PositiveInt]'>: attribute lookup InputFields[PositiveInt] on kiwi.data.encoders.wmt_qe_data_encoder failed

Screenshots 2 1

Environment (please complete the following information):

I have no idea about this Error,Could someone help me?Thanks.

jlx339 commented 2 years ago

I encountered the same error, please help.

dmar1n commented 2 years ago

Hi!

I also encountered a 'PicklingError' when trying to train in a multi-GPU machine. If this is your case, you can maybe set one single device with CUDA_VISIBLE_DEVICES. That worked for me at least.