预训练word2vec

http://zh-v2.d2l.ai/chapter_natural-language-processing-pretraining/word2vec-pretraining.html

有同学在训练的时候遇到这个问题吗:
AttributeError: Can’t pickle local object ‘load_data_ptb..PTBDataset’
EOFError: Ran out of input

我也遇到了这个问题
AttributeError: Can’t pickle local object ‘load_data_ptb..PTBDataset’
Traceback (most recent call last):
File “”, line 1, in
File “D:\Study\soft_ware\anaconda\envs\nlp\lib\multiprocessing\spawn.py”, line 99, in spawn_main
new_handle = reduction.steal_handle(parent_pid, pipe_handle)
File “D:\Study\soft_ware\anaconda\envs\nlp\lib\multiprocessing\reduction.py”, line 87, in steal_handle
_winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] 拒绝访问。

我也遇到了这个问题,把d2l.laod_data_ptb里面的num_works改成零就可以了,多线程的问题。