You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
加载模型报错ValueError: prefetch_factor option could only be specified in multiprocessing.let num_workers > 0 to enable multiprocessing, otherwise set prefetch_factor to None.
#453
Open
licamla opened this issue
Mar 28, 2023
· 2 comments
from fastHan import FastHan
model = FastHan()
model.set_cws_style('cityu')
model('加载模型报错')
加载模型报错
File "/lib/python3.10/site-packages/fastNLP/core/dataloaders/torch_dataloader/fdl.py", line 152, in __init__
super().__init__(**dl_kwargs)
File "/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 245, in __init__
raise ValueError('prefetch_factor option could only be specified in multiprocessing.'
ValueError: prefetch_factor option could only be specified in multiprocessing.let num_workers > 0 to enable multiprocessing, otherwise set prefetch_factor to None.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
licamla
changed the title
下载模型报错ValueError: prefetch_factor option could only be specified in multiprocessing.let num_workers > 0 to enable multiprocessing, otherwise set prefetch_factor to None.
加载模型报错ValueError: prefetch_factor option could only be specified in multiprocessing.let num_workers > 0 to enable multiprocessing, otherwise set prefetch_factor to None.
Mar 28, 2023
Describe the bug
加载模型报错
Desktop (please complete the following information):
torch 2.0.0+cpu
FastNLP 1.0.1
Additional context
torch的DataLoader参数num_workers=0时,prefetch_factor需要设置成None。
而fastNLP里的子类TorchDataLoader的默认num_workers=0,prefetch_factor=2。按道理来说TorchDataLoader应该像DataLoader默认prefetch_factor=None
The text was updated successfully, but these errors were encountered: