Help us understand the problem. What is going on with this article?

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

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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away