I've followed the PyTorch DeepExplainer nb tutorial and made sure that the ranges and dtypes of my lists/arrays match accordingly, but for some reason when calling shap.image_plot I get black images with the warning:
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Here's a screenshot showing the issue and the dtypes/ranges:

I think the only difference is that I'm using 3 color channel images (RGB).
I have the same problem, have you found a solution @austinmw ?
I discovered that for me the issue was that while transforming the data I was normalizing the images (in order to use transfer learning) but this pushed all the pixels towards black. By inverting the normalization within the imshow function I was able to plot the original images.
For me what worked is
(img * 255).astype(np.uint8)
I also got the same problem, how I can solve it?
I discovered that for me the issue was that while transforming the data I was normalizing the images (in order to use transfer learning) but this pushed all the pixels towards black. By inverting the normalization within the imshow function I was able to plot the original images.
Hello, I also did normalize for transfer learning,> I discovered that for me the issue was that while transforming the data I was normalizing the images (in order to use transfer learning) but this pushed all the pixels towards black. By inverting the normalization within the imshow function I was able to plot the original images.
Hello, I also did normalize for transfer learning,did you tell me the detailed code for me to address this problem?
For me what worked is
(img * 255).astype(np.uint8)
Hi! May I know where do I plug this value in? Since the problem occurs at the image_plot() method of shap. Thanks!
Most helpful comment
For me what worked is
(img * 255).astype(np.uint8)