sicara / tf-explain

Interpretability Methods for tf.keras models with Tensorflow 2.x
https://tf-explain.readthedocs.io
MIT License
1.02k stars 112 forks source link

slice index 2 of dimension 1 out of bounds. #188

Open LeeBinshan opened 7 months ago

LeeBinshan commented 7 months ago

I plot the GradCAM with my model(input 12424) and data (24241) so happens: “Exception has occurred: InvalidArgumentError slice index 2 of dimension 1 out of bounds. [Op:StridedSlice] name: strided_slice/ tensorflow.python.eager.core._NotOkStatusException: InvalidArgumentError: slice index 2 of dimension 1 out of bounds. [Op:StridedSlice]

During handling of the above exception, another exception occurred:

File "/home/libinshan/projects/FPAlg/SRCXTestTool/AS/vis_tf_explain.py", line 22, in grid = explainer.explain(data, model, class_index=2) # 281 is the tabby cat index in ImageNet tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 2 of dimension 1 out of bounds. [Op:StridedSlice] name: strided_slice/ ”