Fix dependencies and kernel crash in captumyt.py #2408
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2290
Description
The following changes are proposed:
Flask-compress is explicitly installed because it is needed for the Captum Insights example. It is not installed in Google Colab, although
flask==2.2.4
is there.matplotlib==3.3.4
(ref) is installed because Captum uses an older version of a matplotlib function whose arguments have been renamed recently. Check the following stack trace to confirm:The kernel crash issue in MODEL UNDERSTANDING WITH CAPTUM tutorial: Canceled future for execute_request message before replies were done The Kernel crashed while executing code in the the current cell or a previous cell. #2290 happens due to insufficient RAM when running the following line:
attributions_ig = integrated_gradients.attribute(input_img, target=pred_label_idx, n_steps=200)
. This is likely because the currently used modelresnet101
is too large. I even usedresnet50
but faced the same issue. I did not face this issue withresnet18
, so I replacedresnet101
withresnet18
.Checklist
cc @suraj813