Closed OnkarMulay closed 3 years ago
Code %%time %load_ext autoreload %autoreload 2 import os,sys from skimage.segmentation import mark_boundaries from lime import lime_image import lime
explainer = lime_image.LimeImageExplainer() explanation = explainer.explain_instance(images[0].astype('double'), model.predict, top_labels=1, hide_color=0, num_samples=1)
Error IndexError Traceback (most recent call last)
It sounds like model.predict just outputs a single label, rather than an array of prediction probabilities.
Code %%time %load_ext autoreload %autoreload 2 import os,sys from skimage.segmentation import mark_boundaries from lime import lime_image import lime
explainer = lime_image.LimeImageExplainer() explanation = explainer.explain_instance(images[0].astype('double'), model.predict, top_labels=1, hide_color=0, num_samples=1)
Error IndexError Traceback (most recent call last)