3DUNet-Pytorch icon indicating copy to clipboard operation
3DUNet-Pytorch copied to clipboard

RuntimeError: CUDA error: an illegal memory access was encountered

Open Jiaxi-Z opened this issue 3 years ago • 1 comments

你好lee-zq,

非常感谢你的方法! 我在训练的时候遇到了这个问题:


=======Epoch:1=======
  0%|                                                                                                                                                                                | 0/2 [00:00<?, ?it/s]/home/jiaxi/anaconda3/envs/DKFZ/lib/python3.6/site-packages/scipy/ndimage/interpolation.py:583: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed.
  "the returned array has changed.", UserWarning)
  0%|                                                                                                                                                                                | 0/2 [00:04<?, ?it/s]
Traceback (most recent call last):
  File "train.py", line 103, in <module>
    train_log = train(model, train_loader, optimizer)
  File "train.py", line 66, in train
    optimizer.step()
  File "/home/jiaxi/anaconda3/envs/DKFZ/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/jiaxi/anaconda3/envs/DKFZ/lib/python3.6/site-packages/torch/optim/adam.py", line 119, in step
    group['eps']
  File "/home/jiaxi/anaconda3/envs/DKFZ/lib/python3.6/site-packages/torch/optim/functional.py", line 94, in adam
    denom = (exp_avg_sq.sqrt() / math.sqrt(bias_correction2)).add_(eps)
RuntimeError: CUDA error: an illegal memory access was encountered

非常感谢你的帮助。

Jiaxi-Z avatar Feb 22 '21 13:02 Jiaxi-Z

你好,我之前遇到的问题是发生在Ubuntu 20.04 上的,虽然不知道为什么。 切换为Windows10,就没有这个问题了。

Jiaxi-Z avatar Feb 23 '21 17:02 Jiaxi-Z