Skip to content
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

MAGMA gesdd : the updating process of SBDSDC did not converge #97

Open
smitheric95 opened this issue Mar 30, 2020 · 2 comments · May be fixed by #99
Open

MAGMA gesdd : the updating process of SBDSDC did not converge #97

smitheric95 opened this issue Mar 30, 2020 · 2 comments · May be fixed by #99

Comments

@smitheric95
Copy link

smitheric95 commented Mar 30, 2020

Certain segmentation masks seem to make the stylization process fail.

Here's the output:

eric@desktop:~/FastPhotoStyle$ python3 demo.py --content_image_path cont_img.png --content_seg_path cont_seg.png --style_image_path styl_img.png --style_seg_path styl_seg.png --output_image_path test.png --fast
Resize image: (1280,760)->(1280,760)
Resize image: (2048,1024)->(960,480)

Intel MKL ERROR: Parameter 4 was incorrect on entry to SLASCL.

Intel MKL ERROR: Parameter 4 was incorrect on entry to SLASCL.
Elapsed time in stylization: 0.494351
Traceback (most recent call last):
  File "demo.py", line 49, in <module>
    device=args.device
  File "/home/eric/FastPhotoStyle/process_stylization.py", line 122, in stylization
    stylized_img = stylization_module.transform(cont_img, styl_img, cont_seg, styl_seg)
  File "/home/eric/FastPhotoStyle/photo_wct.py", line 35, in transform
    csF4 = self.__feature_wct(cF4, sF4, cont_seg, styl_seg)
  File "/home/eric/FastPhotoStyle/photo_wct.py", line 108, in __feature_wct
    tmp_target_feature = self.__wct_core(cFFG, sFFG)
  File "/home/eric/FastPhotoStyle/photo_wct.py", line 149, in __wct_core
    s_u, s_e, s_v = torch.svd(styleConv, some=False)
RuntimeError: MAGMA gesdd : the updating process of SBDSDC did not converge (error: 14) at /opt/conda/conda-bld/pytorch_1544197736932/work/aten/src/THC/generic/THCTensorMathMagma.cu:383

I tried reverting back to the scipy gesvd algorithm for singular value decomposition, however, the matrix appears to have infinite values.

I've also tried several conda environments with different combinations of Python/CUDA/Torch as #13 mentions it might be an environment issue.

Interestingly, if I revert to CUDA 9.2 (the last version compatible w my RTX card), the code fails on the line before:

  File "/home/eric/FastPhotoStyle/photo_wct.py", line 148, in __wct_core
    styleConv = torch.mm(styl_feat, styl_feat.t()).div(sFSize[1] - 1)
RuntimeError: invalid argument 3: divide by zero at /opt/conda/conda-bld/pytorch_1532575968863/work/aten/src/THC/generic/THCTensorMathPairwise.cu:88

This might explain those infinite values?

phmalek added a commit to phmalek/FastPhotoStyle that referenced this issue May 12, 2020
`torch.svd` cannot handle infinties.
closes NVIDIA#13, closes NVIDIA#97
@phmalek phmalek linked a pull request May 12, 2020 that will close this issue
@Yi19960820
Copy link

捕获
Hello, sir, I encountered the same problem as you. After another epoch on my neural network, such a problem occurred. Have you found a solution?

@smitheric95
Copy link
Author

捕获
Hello, sir, I encountered the same problem as you. After another epoch on my neural network, such a problem occurred. Have you found a solution?

@Yi19960820, yes I have: https://github.com/smitheric95/FastPhotoStyle/commit/d2d7e447ab4bc3c19cb2c843f4bea28b3dc8186a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants