junyuchen245 / TransMorph_Transformer_for_Medical_Image_Registration

TransMorph: Transformer for Unsupervised Medical Image Registration (PyTorch)
MIT License
456 stars 75 forks source link

GPU out of memory #77

Open hasan-ghavidel opened 6 months ago

hasan-ghavidel commented 6 months ago

i received this error:

/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/functional.py:512: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3587.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] Best model: TransMorph_Validation_dsc0.744.pth.tar Traceback (most recent call last): File "/scratch/h/H.Ghavidel/TransMorph_Transformer_for_Medical_Image_Registration/IXI/TransMorph/infer_TransMorph.py", line 120, in main() File "/scratch/h/H.Ghavidel/TransMorph_Transformer_for_Medical_Image_Registration/IXI/TransMorph/infer_TransMorph.py", line 68, in main x_def, flow = model(x_in) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(args, kwargs) File "/scratch/h/H.Ghavidel/TransMorph_Transformer_for_Medical_Image_Registration/IXI/TransMorph/models/TransMorph.py", line 859, in forward f5 = self.c2(x_s0) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, *kwargs) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/container.py", line 217, in forward input = module(input) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/conv.py", line 610, in forward return self._conv_forward(input, self.weight, self.bias) File "/home/h/H.Ghavidel/venv/my_venv/lib64/python3.9/site-packages/torch/nn/modules/conv.py", line 605, in _conv_forward return F.conv3d( torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 420.00 MiB. GPU

may anyone helps me to fix it