question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NaNs in Gradient of RGB to LAB Transformation

See original GitHub issue

NaNs in Gradient of RGB to LAB Transformation

To Reproduce

Steps to reproduce the behavior:

  1. Apply rgb_to_lab transform to image.
  2. Compute gradient of sum over new image pixels with respect to original input image.
x_new = kornia.color.rgb_to_lab(x)
grad = torch.autograd.grad(x_new.sum(), x)[0].detach()

Expected behavior

There were no NaNs in the output image x_new, so if this transform is differentiable, there should be no NaNs in the gradient.

Environment

PyTorch version: 1.7.1 Is debug build: False CUDA used to build PyTorch: 10.2 ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64) GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Clang version: Could not collect CMake version: Could not collect

Python version: 3.6 (64-bit runtime) Is CUDA available: True CUDA runtime version: Could not collect GPU models and configuration: GPU 0: GeForce GTX 1080 Ti GPU 1: GeForce GTX 1080 Ti

Nvidia driver version: 450.57 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A

Versions of relevant libraries: [pip3] numpy==1.19.5 [pip3] pytorch-colors==0.1.0 [pip3] torch==1.7.1 [pip3] torchvision==0.8.1 [conda] Could not collect

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sreenithycommented, Mar 10, 2021

@cceyda It was the range issue. Sorted thank you.

1reaction
edgarribacommented, Mar 6, 2021

@cceyda any final decision on this ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Colour space conversion - Part 1 - HSV to RGB - YouTube
Colour space conversion - Part 1 - HSV to RGBPart 1 of a two-part mini-series on colour space conversion. In this episode, I...
Read more >
xahidbuffon/TF_RGB_LAB: TensorFlow module for RGB (from ...
TensorFlow module for RGB (from / to) LAB color-space conversion. - GitHub - xahidbuffon/TF_RGB_LAB: TensorFlow module for RGB (from / to) LAB color-space ......
Read more >
Expressions | Vega
The current input data object, available within data transform and event handler expressions. ... This method will return true for null and NaN...
Read more >
HunterLab - 11.3676, 0.1325, 0.8782 - Converting Colors
These gradients show how the HunterLab color 11.3676, 0.1325, 0.8782 changes by changing the brightness by 10 percent. The first figure shows a...
Read more >
Converting Color Spaces in JavaScript - CSS-Tricks
Converting RGB to hex is merely a change of radices. We convert the red, green, and blue values from decimal to hexadecimal using ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found