Commit faac087
Lazy import matplotlib.pyplot to prevent lockfile errors (#1653)
Summary:
Pull Request resolved: #1653
Lazy import matplotlib to avoid lockfile issues with some of the font files when importing captum library in multithreaded environments eg:
```
[2025-10-01T04:02:13.219-07:00] TimeoutError: Lock error: Matplotlib failed to acquire the following lock file:
[2025-10-01T04:02:13.219-07:00] /var/twsvcscm/.cache/matplotlib/fontlist-v330.json.matplotlib-lock
[2025-10-01T04:02:13.219-07:00] This maybe due to another process holding this lock file. If you are sure no
[2025-10-01T04:02:13.219-07:00] other Matplotlib process is running, remove this file and try again.
```
Reviewed By: craymichael
Differential Revision: D83707766
fbshipit-source-id: 8a5b9a537946f5856c3cb8c9a2891b9a57daf0a51 parent 7dc0506 commit faac087
1 file changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
13 | | - | |
14 | 25 | | |
15 | 26 | | |
16 | 27 | | |
| |||
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
| |||
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
148 | | - | |
| 162 | + | |
149 | 163 | | |
150 | 164 | | |
151 | 165 | | |
| |||
167 | 181 | | |
168 | 182 | | |
169 | 183 | | |
| 184 | + | |
| 185 | + | |
170 | 186 | | |
171 | 187 | | |
172 | 188 | | |
| |||
243 | 259 | | |
244 | 260 | | |
245 | 261 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 262 | + | |
249 | 263 | | |
250 | 264 | | |
251 | 265 | | |
| |||
255 | 269 | | |
256 | 270 | | |
257 | 271 | | |
| 272 | + | |
| 273 | + | |
258 | 274 | | |
259 | 275 | | |
260 | 276 | | |
| |||
0 commit comments