13
6

More than 3 years have passed since last update.

RuntimeError: DataLoader worker (pid(s) ~) exited unexpectedlyの原因と解決法

Posted at

実行環境

  • Windows10 Home
  • torch 1.1.0

PytorchでDataLoaderを使おうとしたところ以下のエラーが発生

実行したプログラム
torch.utils.data.DataLoader(
                            dataset = dataset,
                            batch_size = 100,
                            shuffle = True,
                            num_workers = 8)

エラー文
RuntimeError: DataLoader worker (pid(s) ~) exited unexpectedly

原因

メモリ不足が原因

解決策

num_workersをエラーが出ない値まで小さくする
ex) num_workers = 0 等

13
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
6