遇到这几个错,大多是因为内存不足。
我的解决方法:
方案一: pin memory 不变,pin memory的值仍然为True,不需要改为False,而是把batch_size 和 num_worker的值分别调成:batch_size=2 ,num_worker=0 (如果内存不足的话,batch_size 和 num_worker 都可以调为0)
方案二:pin memory改为False
RuntimeError: Pin memory thread exited unexpectedly 或 OSError: [Errno 9] Bad file descriptor 的解决方法
最新推荐文章于 2024-04-18 07:45:00 发布