pred_sal, pred_edge = model(images) File "/home/ihavc/anaconda3..._line 1656, ">
当前位置:   article > 正文

RuntimeError: CUDA out of memory 的解决_line 1656, in batch_norm training, momentum, eps,

line 1656, in batch_norm training, momentum, eps, torch.backends.cudnn.enabl

    今晚在跑代码的时候出现这个问题,但是查看了一下GPU,命名内存是够的,后面发现虽然自己看到的内存是够的,但是真实的原因的确是因为内存不够导致,最后我调低了batchSize 问题就解决了!

  1. Traceback (most recent call last):
  2. File "train_SCRN.py", line 84, in <module>
  3. pred_sal, pred_edge = model(images)
  4. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  5. result = self.forward(*input, **kwargs)
  6. File "/home/ihavc/PycharmProjects/SCRN-ASSP/model/ResNet_models.py", line 240, in forward
  7. x_s1, x_s2, x_s3, x_s4, x_e1, x_e2, x_e3, x_e4 = self.df4(x_s1, x_s2, x_s3, x_s4, x_e1, x_e2, x_e3, x_e4)
  8. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  9. result = self.forward(*input, **kwargs)
  10. File "/home/ihavc/PycharmProjects/SCRN-ASSP/model/ResNet_models.py", line 121, in forward
  11. self.conv8(x_s3, x_e1) *
  12. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  13. result = self.forward(*input, **kwargs)
  14. File "/home/ihavc/PycharmProjects/SCRN-ASSP/model/ResNet_models.py", line 52, in forward
  15. x = self.conv(F.upsample(x, size=target.size()[2:], mode='bilinear', align_corners=True))
  16. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  17. result = self.forward(*input, **kwargs)
  18. File "/home/ihavc/PycharmProjects/SCRN-ASSP/model/ResNet_models.py", line 28, in forward
  19. x = self.conv_bn(x)
  20. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  21. result = self.forward(*input, **kwargs)
  22. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward
  23. input = module(input)
  24. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
  25. result = self.forward(*input, **kwargs)
  26. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 81, in forward
  27. exponential_average_factor, self.eps)
  28. File "/home/ihavc/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/functional.py", line 1670, in batch_norm
  29. training, momentum, eps, torch.backends.cudnn.enabled
  30. RuntimeError: CUDA out of memory. Tried to allocate 26.00 MiB (GPU 0; 10.73 GiB total capacity; 9.55 GiB already allocated; 28.31 MiB free; 19.44 MiB cached)

 

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号