donglixp / coarse2fine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't pickle generator objects

yoongi0428 opened this issue · comments

Hi Li.

I'm having trouble with running the project.
While running preprocess.py, I got error when torch.save 'train Dataset' as below.
Could you tell me the solution if you know what it is?
I cannot find any generator objects in the dataset class.

error

Hi @yoongi0428 ,

I am afraid it's caused by the different PyTorch version. Please find the requirements in https://github.com/donglixp/coarse2fine/blob/master/README.md .

Thanks for comment. However, I'm having the same problem even if I met all the requirements. Could you please check? Thanks.

I just found that it's about "construct_final" function in wikisql/table/IO.
It 'yield's (not return) so that torchtext example becomes generator rather than a list.
If I return just a list then it works.

Hi @yoongi0428 ,

Thanks!

I tried torchtext==0.2.0, and it worked fine.