Jupyter中训练pytorch网络用了tqdm,报了AssertionError: can only join a child process的错误(具体错误信息见引用),开始以为又是dataloader的问题,实际就是tqdm的bug。
解决办法:
将 from tqdm.auto import tqdm 替换为 from tqdm import tqdm
引用自: https://discuss.pytorch.org/t/error-while-multiprocessing-in-dataloader/46845
作者:jpleet I just got this error. My data is good. And training with num_workers=0 is too slow. For whatever reason, I was able to fix by replacing from tqdm.auto import tqdm with just from tqdm import tqdm Something seems to bug out with parallel dataloaders wrapped around the fancy notebook tqdm with my versions of nodejs and ipywidgets. Hope this helps others.
|