You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to replace Conv2d in a UNet with DeformConv2d and ran into some errors. I'm using CUDA 10.0 and pytorch 1.3.1.
Below is the code for the UNet
This UNet model works fine. However, when I replace nn.Conv2d in self.conv9_2 with DeformConv2d (commented in the above code snippet), some error occurs:
105 self.optimizer.zero_grad()
106
--> 107 outputs = self.model(sources)
108
109 loss = self.criterion(outputs, targets)
~/anaconda3/envs/deformable-kernels/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
539 result = self._slow_forward(*input, **kwargs)
540 else:
--> 541 result = self.forward(*input, **kwargs)
542 for hook in self._forward_hooks.values():
543 hook_result = hook(self, input, result)
<ipython-input-2-b3122d7e7f84> in forward(self, x)
88 up9 = torch.cat((up9, conv1), 1)
89 conv9 = self.lrelu(self.conv9_1(up9))
---> 90 conv9 = self.lrelu(self.conv9_2(conv9))
91
92 out = self.conv10(conv9)
~/anaconda3/envs/deformable-kernels/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
539 result = self._slow_forward(*input, **kwargs)
540 else:
--> 541 result = self.forward(*input, **kwargs)
542 for hook in self._forward_hooks.values():
543 hook_result = hook(self, input, result)
~/anaconda3/envs/deformable-kernels/lib/python3.6/site-packages/torch/nn/modules/activation.py in forward(self, input)
533
534 def forward(self, input):
--> 535 return F.leaky_relu(input, self.negative_slope, self.inplace)
536
537 def extra_repr(self):
~/anaconda3/envs/deformable-kernels/lib/python3.6/site-packages/torch/nn/functional.py in leaky_relu(input, negative_slope, inplace)
1059 """
1060 if inplace:
-> 1061 result = torch._C._nn.leaky_relu_(input, negative_slope)
1062 else:
1063 result = torch._C._nn.leaky_relu(input, negative_slope)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /opt/conda/conda-bld/pytorch_1573049301898/work/aten/src/THCUNN/generic/LeakyReLU.cu:29
I also tried DeformKernel2d and DeformKernelConv2d and they both have the same issue.
Another thing worth mentioning is that the modified UNet is much slower than I expected. The running time for the original UNet is about 7 min per epoch, while the modified UNet needs almost twice the time to complete one epoch. Maybe there is something wrong when I install apex or this package.
The text was updated successfully, but these errors were encountered:
I'm facing a similar memory access issue, except the fact that it's not a cuda runtime error. Instead I get a Segmentation fault (core dumped) error. @hangg7 any help would be greatly appreciated!
Hi,
I was trying to replace Conv2d in a UNet with DeformConv2d and ran into some errors. I'm using
CUDA 10.0
andpytorch 1.3.1
.Below is the code for the UNet
This UNet model works fine. However, when I replace
nn.Conv2d
inself.conv9_2
withDeformConv2d
(commented in the above code snippet), some error occurs:I also tried
DeformKernel2d
andDeformKernelConv2d
and they both have the same issue.Another thing worth mentioning is that the modified UNet is much slower than I expected. The running time for the original UNet is about 7 min per epoch, while the modified UNet needs almost twice the time to complete one epoch. Maybe there is something wrong when I install
apex
or this package.The text was updated successfully, but these errors were encountered: