Can't perform z-score normalization in RGB data #6665
Replies: 4 comments
-
Hi @joaolcguerreiro , to help debug, could you provide more details such as what is the input (tensor's shape) of |
Beta Was this translation helpful? Give feedback.
-
Hi :) The input of In the transform I start by transforming the grayscale image to RGB by repeating the channel dim and obtaining the shape Also, I'm using MONAI 1.1.0, but I believe the source code for NormalizeIntensity is the same as in 1.2.0. |
Beta Was this translation helpful? Give feedback.
-
The problem can be overcome if I detach the gradients from my tensor. However this is not the optimal solution. From:
To:
Is there any alternative?? I've tried almost anything at this point haha. |
Beta Was this translation helpful? Give feedback.
-
Hi @joaolcguerreiro, you can also try to use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to apply a z-score normalization in my RGB data. I am applying the following transforms:
However I'm getting the following error:
RuntimeError: Output 0 of AliasBackward0 is a view and its base or another view of its base has been modified inplace. This view is the output of a function that returns multiple views. Such functions do not allow the output views to be modified inplace. You should replace the inplace operation by an out-of-place one.
I believe the problem is in the line
img[slices] = (img[slices] - _sub) / _div
of_normalize
method inNormalizeIntensity
class.I believe I'm calling the transform correctly or am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions