-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Segmentation fault (core dumped)' in image_harmonization #25
Comments
(1) The released code has been validated and did not raise any errors. (2) The provided information is unable to pinpoint the error. It is suggested to run the code step by step to identify the bug. |
During debugging, I found the error raised from './libcom/image_harmonization/source/functions.py' line 489 class TrilinearInterpolationFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, lut, x):
x = x.contiguous()
output = x.new(x.size())
dim = lut.size()[-1]
shift = dim ** 3
binsize = 1.000001 / (dim-1)
W = x.size(2)
H = x.size(3)
# batch = x.size(0)
batch = x.size(1)
assert 1 == trilinear.forward(lut,
x,
output,
dim,
shift,
binsize,
W,
H,
batch) # <======= Bug came from here
int_package = torch.IntTensor([dim, shift, W, H, batch]) I followed the solution from HuiZeng/Image-Adaptive-3DLUT#70 , but still no work. |
If your PyTorch version is not 1.10.1, please try installing this specific version of PyTorch and then reinstall the libcom library by running |
Thx for reply. I did exactly follow the installation instruction . And the "torch-related" libraries are: open-clip-torch 2.7.0
pytorch-lightning 1.9.0
torch 1.10.1
torchaudio 0.10.1
torchmetrics 1.3.0.post0
torchvision 0.11.2 But still no work. |
The latest code has fixed the trilinear bugs for PyTorch version 1.11.0 or later. Please consider upgrading PyTorch and rebuilding the library. Hope this can help you. Alternatively, you can try the source code for image harmonization, the link to which is provided in our documentation. |
Hi Author,
I ran your code "python test_image_harmonization.py", it always triggered a bug as below:
I found out there was something wrong with the 'CDTNet.pth'. No matter downloaded from the code automatically or from the modelscope.cn, the model just didn't work.
Btw, my Env:
OS - Ubuntu 20.04
GPU - Nvidia 4090
cuda - 11.3.r11.3
python - 3.8.5
Please help or fix the bug.
The text was updated successfully, but these errors were encountered: