Skip to content

Commit 4648254

Browse files
authored
Fix dependencies and kernel crash in captumyt.py (#2408)
* Update captum dependencies (matplotlib and flask-compress) * Use resnet18 due to RAM limitation Google Colab crashes due to insufficient RAM (more than 12 GB is required) if resnet101 or resnet50 are used. Thus, resnet18 is used instead (approximately 6 GB is used).
1 parent 420037e commit 4648254

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

beginner_source/introyt/captumyt.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,24 @@
9898
Before you get started, you need to have a Python environment with:
9999
100100
- Python version 3.6 or higher
101-
- For the Captum Insights example, Flask 1.1 or higher
101+
- For the Captum Insights example, Flask 1.1 or higher and Flask-Compress
102+
(the latest version is recommended)
102103
- PyTorch version 1.2 or higher (the latest version is recommended)
103104
- TorchVision version 0.6 or higher (the latest version is recommended)
104105
- Captum (the latest version is recommended)
106+
- Matplotlib version 3.3.4, since Captum currently uses a Matplotlib
107+
function whose arguments have been renamed in later versions
105108
106109
To install Captum in an Anaconda or pip virtual environment, use the
107110
appropriate command for your environment below:
108111
109112
With ``conda``::
110113
111-
conda install pytorch torchvision captum -c pytorch
114+
conda install pytorch torchvision captum flask-compress matplotlib=3.3.4 -c pytorch
112115
113116
With ``pip``::
114117
115-
pip install torch torchvision captum
118+
pip install torch torchvision captum matplotlib==3.3.4 Flask-Compress
116119
117120
Restart this notebook in the environment you set up, and you’re ready to
118121
go!
@@ -155,7 +158,7 @@
155158
# now.
156159
#
157160

158-
model = models.resnet101(weights='IMAGENET1K_V1')
161+
model = models.resnet18(weights='IMAGENET1K_V1')
159162
model = model.eval()
160163

161164

0 commit comments

Comments
 (0)