2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PyTorchでRuntimeError: error executing torch_shm_managerが出た時の対象方法

Posted at

Pytorch exampleのsuper resolutionのサンプルを動かそうとしたらエラーがでた。

$ pip install torch torchvision
$  python main.py --upscale_factor 3 --batchSize 4 --testBatchSize 100 --nEpochs 30 --lr 0.001

エラー内容

Traceback (most recent call last):
  File "main.py", line 81, in <module>
    train(epoch)
  File "main.py", line 48, in train
    for iteration, batch in enumerate(training_data_loader, 1):
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 819, in __next__
    return self._process_data(data)
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
    data.reraise()
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise
    raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
    return self.collate_fn(data)
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in default_collate
    return [default_collate(samples) for samples in transposed]
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in <listcomp>
    return [default_collate(samples) for samples in transposed]
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 53, in default_collate
    storage = elem.storage()._new_shared(numel)
  File "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/storage.py", line 128, in _new_shared
    return cls._new_using_filename(size)
RuntimeError: error executing torch_shm_manager at "/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/bin/torch_shm_manager" at ../torch/lib/libshm/core.cpp:99

/Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/bin/torch_shm_managerに実行権限がなかったので、以下のコマンドで実行権限を付与するとよい。

$  chmod +x /Users/xxx/.pyenv/versions/3.7.4/lib/python3.7/site-packages/torch/bin/torch_shm_manager
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?