Cannot pickle 'pyonmttok._ext.Vocab' object

When I train my model at that time I am getting a cannot pickle ‘pyonmttok._ext.Vocab’ object error.

File “/usr/lib/python3.8/multiprocessing/queues.py”, line 239, in _feed
obj = _ForkingPickler.dumps(obj)
File “/usr/lib/python3.8/multiprocessing/reduction.py”, line 51, in dumps
cls(buf, protocol).dump(obj)
TypeError: cannot pickle ‘pyonmttok._ext.Vocab’ object

if you are on windows, use num_workers=0 for now

1 Like