-
Notifications
You must be signed in to change notification settings - Fork 5
/
yolov7_DAG.py
450 lines (382 loc) · 95.5 KB
/
yolov7_DAG.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# add this file to the yolov7 dir
# make a new dir in yolov7 :test to save the video result
# a = [{'name': 'model_0_conv', 'operator': 'conv', 'users': 1, 'args': [], 'calculate': 'getattr(self.model, "0").conv(x)'}, {'name': 'model_0_bn', 'operator': 'bn', 'users': 1, 'args': ['model_0_conv'], 'calculate': 'getattr(self.model, "0").bn(model_0_conv)'}, {'name': 'model_0_act', 'operator': 'act', 'users': 1, 'args': ['model_0_bn'], 'calculate': 'getattr(self.model, "0").act(model_0_bn)'}, {'name': 'model_1_conv', 'operator': 'conv', 'users': 1, 'args': ['model_0_act'], 'calculate': 'getattr(self.model, "1").conv(model_0_act)'}, {'name': 'model_1_bn', 'operator': 'bn', 'users': 1, 'args': ['model_1_conv'], 'calculate': 'getattr(self.model, "1").bn(model_1_conv)'}, {'name': 'model_1_act', 'operator': 'act', 'users': 1, 'args': ['model_1_bn'], 'calculate': 'getattr(self.model, "1").act(model_1_bn)'}, {'name': 'model_2_conv', 'operator': 'conv', 'users': 1, 'args': ['model_1_act'], 'calculate': 'getattr(self.model, "2").conv(model_1_act)'}, {'name': 'model_2_bn', 'operator': 'bn', 'users': 1, 'args': ['model_2_conv'], 'calculate': 'getattr(self.model, "2").bn(model_2_conv)'}, {'name': 'model_2_act', 'operator': 'act', 'users': 1, 'args': ['model_2_bn'], 'calculate': 'getattr(self.model, "2").act(model_2_bn)'}, {'name': 'model_3_conv', 'operator': 'conv', 'users': 1, 'args': ['model_2_act'], 'calculate': 'getattr(self.model, "3").conv(model_2_act)'}, {'name': 'model_3_bn', 'operator': 'bn', 'users': 1, 'args': ['model_3_conv'], 'calculate': 'getattr(self.model, "3").bn(model_3_conv)'}, {'name': 'model_3_act', 'operator': 'act', 'users': 2, 'args': ['model_3_bn'], 'calculate': 'getattr(self.model, "3").act(model_3_bn)'}, {'name': 'model_4_conv', 'operator': 'conv', 'users': 1, 'args': ['model_3_act'], 'calculate': 'getattr(self.model, "4").conv(model_3_act)'}, {'name': 'model_4_bn', 'operator': 'bn', 'users': 1, 'args': ['model_4_conv'], 'calculate': 'getattr(self.model, "4").bn(model_4_conv)'}, {'name': 'model_4_act', 'operator': 'act', 'users': 1, 'args': ['model_4_bn'], 'calculate': 'getattr(self.model, "4").act(model_4_bn)'}, {'name': 'model_5_conv', 'operator': 'conv', 'users': 1, 'args': ['model_3_act'], 'calculate': 'getattr(self.model, "5").conv(model_3_act)'}, {'name': 'model_5_bn', 'operator': 'bn', 'users': 1, 'args': ['model_5_conv'], 'calculate': 'getattr(self.model, "5").bn(model_5_conv)'}, {'name': 'model_5_act', 'operator': 'act', 'users': 2, 'args': ['model_5_bn'], 'calculate': 'getattr(self.model, "5").act(model_5_bn)'}, {'name': 'model_6_conv', 'operator': 'conv', 'users': 1, 'args': ['model_5_act'], 'calculate': 'getattr(self.model, "6").conv(model_5_act)'}, {'name': 'model_6_bn', 'operator': 'bn', 'users': 1, 'args': ['model_6_conv'], 'calculate': 'getattr(self.model, "6").bn(model_6_conv)'}, {'name': 'model_6_act', 'operator': 'act', 'users': 1, 'args': ['model_6_bn'], 'calculate': 'getattr(self.model, "6").act(model_6_bn)'}, {'name': 'model_7_conv', 'operator': 'conv', 'users': 1, 'args': ['model_6_act'], 'calculate': 'getattr(self.model, "7").conv(model_6_act)'}, {'name': 'model_7_bn', 'operator': 'bn', 'users': 1, 'args': ['model_7_conv'], 'calculate': 'getattr(self.model, "7").bn(model_7_conv)'}, {'name': 'model_7_act', 'operator': 'act', 'users': 2, 'args': ['model_7_bn'], 'calculate': 'getattr(self.model, "7").act(model_7_bn)'}, {'name': 'model_8_conv', 'operator': 'conv', 'users': 1, 'args': ['model_7_act'], 'calculate': 'getattr(self.model, "8").conv(model_7_act)'}, {'name': 'model_8_bn', 'operator': 'bn', 'users': 1, 'args': ['model_8_conv'], 'calculate': 'getattr(self.model, "8").bn(model_8_conv)'}, {'name': 'model_8_act', 'operator': 'act', 'users': 1, 'args': ['model_8_bn'], 'calculate': 'getattr(self.model, "8").act(model_8_bn)'}, {'name': 'model_9_conv', 'operator': 'conv', 'users': 1, 'args': ['model_8_act'], 'calculate': 'getattr(self.model, "9").conv(model_8_act)'}, {'name': 'model_9_bn', 'operator': 'bn', 'users': 1, 'args': ['model_9_conv'], 'calculate': 'getattr(self.model, "9").bn(model_9_conv)'}, {'name': 'model_9_act', 'operator': 'act', 'users': 1, 'args': ['model_9_bn'], 'calculate': 'getattr(self.model, "9").act(model_9_bn)'}, {'name': 'cat', 'operator': 'cat', 'users': 1, 'args': ['model_9_act', 'model_7_act', 'model_5_act', 'model_4_act'], 'calculate': 'torch.cat([model_9_act, model_7_act, model_5_act, model_4_act], 1)'}, {'name': 'model_11_conv', 'operator': 'conv', 'users': 1, 'args': ['cat'], 'calculate': 'getattr(self.model, "11").conv(cat)'}, {'name': 'model_11_bn', 'operator': 'bn', 'users': 1, 'args': ['model_11_conv'], 'calculate': 'getattr(self.model, "11").bn(model_11_conv)'}, {'name': 'model_11_act', 'operator': 'act', 'users': 2, 'args': ['model_11_bn'], 'calculate': 'getattr(self.model, "11").act(model_11_bn)'}, {'name': 'model_12_m', 'operator': 'm', 'users': 1, 'args': ['model_11_act'], 'calculate': 'getattr(self.model, "12").m(model_11_act)'}, {'name': 'model_13_conv', 'operator': 'conv', 'users': 1, 'args': ['model_12_m'], 'calculate': 'getattr(self.model, "13").conv(model_12_m)'}, {'name': 'model_13_bn', 'operator': 'bn', 'users': 1, 'args': ['model_13_conv'], 'calculate': 'getattr(self.model, "13").bn(model_13_conv)'}, {'name': 'model_13_act', 'operator': 'act', 'users': 1, 'args': ['model_13_bn'], 'calculate': 'getattr(self.model, "13").act(model_13_bn)'}, {'name': 'model_14_conv', 'operator': 'conv', 'users': 1, 'args': ['model_11_act'], 'calculate': 'getattr(self.model, "14").conv(model_11_act)'}, {'name': 'model_14_bn', 'operator': 'bn', 'users': 1, 'args': ['model_14_conv'], 'calculate': 'getattr(self.model, "14").bn(model_14_conv)'}, {'name': 'model_14_act', 'operator': 'act', 'users': 1, 'args': ['model_14_bn'], 'calculate': 'getattr(self.model, "14").act(model_14_bn)'}, {'name': 'model_15_conv', 'operator': 'conv', 'users': 1, 'args': ['model_14_act'], 'calculate': 'getattr(self.model, "15").conv(model_14_act)'}, {'name': 'model_15_bn', 'operator': 'bn', 'users': 1, 'args': ['model_15_conv'], 'calculate': 'getattr(self.model, "15").bn(model_15_conv)'}, {'name': 'model_15_act', 'operator': 'act', 'users': 1, 'args': ['model_15_bn'], 'calculate': 'getattr(self.model, "15").act(model_15_bn)'}, {'name': 'cat_1', 'operator': '1', 'users': 2, 'args': ['model_15_act', 'model_13_act'], 'calculate': 'torch.cat([model_15_act, model_13_act], 1)'}, {'name': 'model_17_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_1'], 'calculate': 'getattr(self.model, "17").conv(cat_1)'}, {'name': 'model_17_bn', 'operator': 'bn', 'users': 1, 'args': ['model_17_conv'], 'calculate': 'getattr(self.model, "17").bn(model_17_conv)'}, {'name': 'model_17_act', 'operator': 'act', 'users': 1, 'args': ['model_17_bn'], 'calculate': 'getattr(self.model, "17").act(model_17_bn)'}, {'name': 'model_18_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_1'], 'calculate': 'getattr(self.model, "18").conv(cat_1)'}, {'name': 'model_18_bn', 'operator': 'bn', 'users': 1, 'args': ['model_18_conv'], 'calculate': 'getattr(self.model, "18").bn(model_18_conv)'}, {'name': 'model_18_act', 'operator': 'act', 'users': 2, 'args': ['model_18_bn'], 'calculate': 'getattr(self.model, "18").act(model_18_bn)'}, {'name': 'model_19_conv', 'operator': 'conv', 'users': 1, 'args': ['model_18_act'], 'calculate': 'getattr(self.model, "19").conv(model_18_act)'}, {'name': 'model_19_bn', 'operator': 'bn', 'users': 1, 'args': ['model_19_conv'], 'calculate': 'getattr(self.model, "19").bn(model_19_conv)'}, {'name': 'model_19_act', 'operator': 'act', 'users': 1, 'args': ['model_19_bn'], 'calculate': 'getattr(self.model, "19").act(model_19_bn)'}, {'name': 'model_20_conv', 'operator': 'conv', 'users': 1, 'args': ['model_19_act'], 'calculate': 'getattr(self.model, "20").conv(model_19_act)'}, {'name': 'model_20_bn', 'operator': 'bn', 'users': 1, 'args': ['model_20_conv'], 'calculate': 'getattr(self.model, "20").bn(model_20_conv)'}, {'name': 'model_20_act', 'operator': 'act', 'users': 2, 'args': ['model_20_bn'], 'calculate': 'getattr(self.model, "20").act(model_20_bn)'}, {'name': 'model_21_conv', 'operator': 'conv', 'users': 1, 'args': ['model_20_act'], 'calculate': 'getattr(self.model, "21").conv(model_20_act)'}, {'name': 'model_21_bn', 'operator': 'bn', 'users': 1, 'args': ['model_21_conv'], 'calculate': 'getattr(self.model, "21").bn(model_21_conv)'}, {'name': 'model_21_act', 'operator': 'act', 'users': 1, 'args': ['model_21_bn'], 'calculate': 'getattr(self.model, "21").act(model_21_bn)'}, {'name': 'model_22_conv', 'operator': 'conv', 'users': 1, 'args': ['model_21_act'], 'calculate': 'getattr(self.model, "22").conv(model_21_act)'}, {'name': 'model_22_bn', 'operator': 'bn', 'users': 1, 'args': ['model_22_conv'], 'calculate': 'getattr(self.model, "22").bn(model_22_conv)'}, {'name': 'model_22_act', 'operator': 'act', 'users': 1, 'args': ['model_22_bn'], 'calculate': 'getattr(self.model, "22").act(model_22_bn)'}, {'name': 'cat_2', 'operator': '2', 'users': 1, 'args': ['model_22_act', 'model_20_act', 'model_18_act', 'model_17_act'], 'calculate': 'torch.cat([model_22_act, model_20_act, model_18_act, model_17_act], 1)'}, {'name': 'model_24_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_2'], 'calculate': 'getattr(self.model, "24").conv(cat_2)'}, {'name': 'model_24_bn', 'operator': 'bn', 'users': 1, 'args': ['model_24_conv'], 'calculate': 'getattr(self.model, "24").bn(model_24_conv)'}, {'name': 'model_24_act', 'operator': 'act', 'users': 3, 'args': ['model_24_bn'], 'calculate': 'getattr(self.model, "24").act(model_24_bn)'}, {'name': 'model_25_m', 'operator': 'm', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "25").m(model_24_act)'}, {'name': 'model_26_conv', 'operator': 'conv', 'users': 1, 'args': ['model_25_m'], 'calculate': 'getattr(self.model, "26").conv(model_25_m)'}, {'name': 'model_26_bn', 'operator': 'bn', 'users': 1, 'args': ['model_26_conv'], 'calculate': 'getattr(self.model, "26").bn(model_26_conv)'}, {'name': 'model_26_act', 'operator': 'act', 'users': 1, 'args': ['model_26_bn'], 'calculate': 'getattr(self.model, "26").act(model_26_bn)'}, {'name': 'model_27_conv', 'operator': 'conv', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "27").conv(model_24_act)'}, {'name': 'model_27_bn', 'operator': 'bn', 'users': 1, 'args': ['model_27_conv'], 'calculate': 'getattr(self.model, "27").bn(model_27_conv)'}, {'name': 'model_27_act', 'operator': 'act', 'users': 1, 'args': ['model_27_bn'], 'calculate': 'getattr(self.model, "27").act(model_27_bn)'}, {'name': 'model_28_conv', 'operator': 'conv', 'users': 1, 'args': ['model_27_act'], 'calculate': 'getattr(self.model, "28").conv(model_27_act)'}, {'name': 'model_28_bn', 'operator': 'bn', 'users': 1, 'args': ['model_28_conv'], 'calculate': 'getattr(self.model, "28").bn(model_28_conv)'}, {'name': 'model_28_act', 'operator': 'act', 'users': 1, 'args': ['model_28_bn'], 'calculate': 'getattr(self.model, "28").act(model_28_bn)'}, {'name': 'cat_3', 'operator': '3', 'users': 2, 'args': ['model_28_act', 'model_26_act'], 'calculate': 'torch.cat([model_28_act, model_26_act], 1)'}, {'name': 'model_30_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_3'], 'calculate': 'getattr(self.model, "30").conv(cat_3)'}, {'name': 'model_30_bn', 'operator': 'bn', 'users': 1, 'args': ['model_30_conv'], 'calculate': 'getattr(self.model, "30").bn(model_30_conv)'}, {'name': 'model_30_act', 'operator': 'act', 'users': 1, 'args': ['model_30_bn'], 'calculate': 'getattr(self.model, "30").act(model_30_bn)'}, {'name': 'model_31_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_3'], 'calculate': 'getattr(self.model, "31").conv(cat_3)'}, {'name': 'model_31_bn', 'operator': 'bn', 'users': 1, 'args': ['model_31_conv'], 'calculate': 'getattr(self.model, "31").bn(model_31_conv)'}, {'name': 'model_31_act', 'operator': 'act', 'users': 2, 'args': ['model_31_bn'], 'calculate': 'getattr(self.model, "31").act(model_31_bn)'}, {'name': 'model_32_conv', 'operator': 'conv', 'users': 1, 'args': ['model_31_act'], 'calculate': 'getattr(self.model, "32").conv(model_31_act)'}, {'name': 'model_32_bn', 'operator': 'bn', 'users': 1, 'args': ['model_32_conv'], 'calculate': 'getattr(self.model, "32").bn(model_32_conv)'}, {'name': 'model_32_act', 'operator': 'act', 'users': 1, 'args': ['model_32_bn'], 'calculate': 'getattr(self.model, "32").act(model_32_bn)'}, {'name': 'model_33_conv', 'operator': 'conv', 'users': 1, 'args': ['model_32_act'], 'calculate': 'getattr(self.model, "33").conv(model_32_act)'}, {'name': 'model_33_bn', 'operator': 'bn', 'users': 1, 'args': ['model_33_conv'], 'calculate': 'getattr(self.model, "33").bn(model_33_conv)'}, {'name': 'model_33_act', 'operator': 'act', 'users': 2, 'args': ['model_33_bn'], 'calculate': 'getattr(self.model, "33").act(model_33_bn)'}, {'name': 'model_34_conv', 'operator': 'conv', 'users': 1, 'args': ['model_33_act'], 'calculate': 'getattr(self.model, "34").conv(model_33_act)'}, {'name': 'model_34_bn', 'operator': 'bn', 'users': 1, 'args': ['model_34_conv'], 'calculate': 'getattr(self.model, "34").bn(model_34_conv)'}, {'name': 'model_34_act', 'operator': 'act', 'users': 1, 'args': ['model_34_bn'], 'calculate': 'getattr(self.model, "34").act(model_34_bn)'}, {'name': 'model_35_conv', 'operator': 'conv', 'users': 1, 'args': ['model_34_act'], 'calculate': 'getattr(self.model, "35").conv(model_34_act)'}, {'name': 'model_35_bn', 'operator': 'bn', 'users': 1, 'args': ['model_35_conv'], 'calculate': 'getattr(self.model, "35").bn(model_35_conv)'}, {'name': 'model_35_act', 'operator': 'act', 'users': 1, 'args': ['model_35_bn'], 'calculate': 'getattr(self.model, "35").act(model_35_bn)'}, {'name': 'cat_4', 'operator': '4', 'users': 1, 'args': ['model_35_act', 'model_33_act', 'model_31_act', 'model_30_act'], 'calculate': 'torch.cat([model_35_act, model_33_act, model_31_act, model_30_act], 1)'}, {'name': 'model_37_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_4'], 'calculate': 'getattr(self.model, "37").conv(cat_4)'}, {'name': 'model_37_bn', 'operator': 'bn', 'users': 1, 'args': ['model_37_conv'], 'calculate': 'getattr(self.model, "37").bn(model_37_conv)'}, {'name': 'model_37_act', 'operator': 'act', 'users': 3, 'args': ['model_37_bn'], 'calculate': 'getattr(self.model, "37").act(model_37_bn)'}, {'name': 'model_38_m', 'operator': 'm', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "38").m(model_37_act)'}, {'name': 'model_39_conv', 'operator': 'conv', 'users': 1, 'args': ['model_38_m'], 'calculate': 'getattr(self.model, "39").conv(model_38_m)'}, {'name': 'model_39_bn', 'operator': 'bn', 'users': 1, 'args': ['model_39_conv'], 'calculate': 'getattr(self.model, "39").bn(model_39_conv)'}, {'name': 'model_39_act', 'operator': 'act', 'users': 1, 'args': ['model_39_bn'], 'calculate': 'getattr(self.model, "39").act(model_39_bn)'}, {'name': 'model_40_conv', 'operator': 'conv', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "40").conv(model_37_act)'}, {'name': 'model_40_bn', 'operator': 'bn', 'users': 1, 'args': ['model_40_conv'], 'calculate': 'getattr(self.model, "40").bn(model_40_conv)'}, {'name': 'model_40_act', 'operator': 'act', 'users': 1, 'args': ['model_40_bn'], 'calculate': 'getattr(self.model, "40").act(model_40_bn)'}, {'name': 'model_41_conv', 'operator': 'conv', 'users': 1, 'args': ['model_40_act'], 'calculate': 'getattr(self.model, "41").conv(model_40_act)'}, {'name': 'model_41_bn', 'operator': 'bn', 'users': 1, 'args': ['model_41_conv'], 'calculate': 'getattr(self.model, "41").bn(model_41_conv)'}, {'name': 'model_41_act', 'operator': 'act', 'users': 1, 'args': ['model_41_bn'], 'calculate': 'getattr(self.model, "41").act(model_41_bn)'}, {'name': 'cat_5', 'operator': '5', 'users': 2, 'args': ['model_41_act', 'model_39_act'], 'calculate': 'torch.cat([model_41_act, model_39_act], 1)'}, {'name': 'model_43_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_5'], 'calculate': 'getattr(self.model, "43").conv(cat_5)'}, {'name': 'model_43_bn', 'operator': 'bn', 'users': 1, 'args': ['model_43_conv'], 'calculate': 'getattr(self.model, "43").bn(model_43_conv)'}, {'name': 'model_43_act', 'operator': 'act', 'users': 1, 'args': ['model_43_bn'], 'calculate': 'getattr(self.model, "43").act(model_43_bn)'}, {'name': 'model_44_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_5'], 'calculate': 'getattr(self.model, "44").conv(cat_5)'}, {'name': 'model_44_bn', 'operator': 'bn', 'users': 1, 'args': ['model_44_conv'], 'calculate': 'getattr(self.model, "44").bn(model_44_conv)'}, {'name': 'model_44_act', 'operator': 'act', 'users': 2, 'args': ['model_44_bn'], 'calculate': 'getattr(self.model, "44").act(model_44_bn)'}, {'name': 'model_45_conv', 'operator': 'conv', 'users': 1, 'args': ['model_44_act'], 'calculate': 'getattr(self.model, "45").conv(model_44_act)'}, {'name': 'model_45_bn', 'operator': 'bn', 'users': 1, 'args': ['model_45_conv'], 'calculate': 'getattr(self.model, "45").bn(model_45_conv)'}, {'name': 'model_45_act', 'operator': 'act', 'users': 1, 'args': ['model_45_bn'], 'calculate': 'getattr(self.model, "45").act(model_45_bn)'}, {'name': 'model_46_conv', 'operator': 'conv', 'users': 1, 'args': ['model_45_act'], 'calculate': 'getattr(self.model, "46").conv(model_45_act)'}, {'name': 'model_46_bn', 'operator': 'bn', 'users': 1, 'args': ['model_46_conv'], 'calculate': 'getattr(self.model, "46").bn(model_46_conv)'}, {'name': 'model_46_act', 'operator': 'act', 'users': 2, 'args': ['model_46_bn'], 'calculate': 'getattr(self.model, "46").act(model_46_bn)'}, {'name': 'model_47_conv', 'operator': 'conv', 'users': 1, 'args': ['model_46_act'], 'calculate': 'getattr(self.model, "47").conv(model_46_act)'}, {'name': 'model_47_bn', 'operator': 'bn', 'users': 1, 'args': ['model_47_conv'], 'calculate': 'getattr(self.model, "47").bn(model_47_conv)'}, {'name': 'model_47_act', 'operator': 'act', 'users': 1, 'args': ['model_47_bn'], 'calculate': 'getattr(self.model, "47").act(model_47_bn)'}, {'name': 'model_48_conv', 'operator': 'conv', 'users': 1, 'args': ['model_47_act'], 'calculate': 'getattr(self.model, "48").conv(model_47_act)'}, {'name': 'model_48_bn', 'operator': 'bn', 'users': 1, 'args': ['model_48_conv'], 'calculate': 'getattr(self.model, "48").bn(model_48_conv)'}, {'name': 'model_48_act', 'operator': 'act', 'users': 1, 'args': ['model_48_bn'], 'calculate': 'getattr(self.model, "48").act(model_48_bn)'}, {'name': 'cat_6', 'operator': '6', 'users': 1, 'args': ['model_48_act', 'model_46_act', 'model_44_act', 'model_43_act'], 'calculate': 'torch.cat([model_48_act, model_46_act, model_44_act, model_43_act], 1)'}, {'name': 'model_50_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_6'], 'calculate': 'getattr(self.model, "50").conv(cat_6)'}, {'name': 'model_50_bn', 'operator': 'bn', 'users': 1, 'args': ['model_50_conv'], 'calculate': 'getattr(self.model, "50").bn(model_50_conv)'}, {'name': 'model_50_act', 'operator': 'act', 'users': 2, 'args': ['model_50_bn'], 'calculate': 'getattr(self.model, "50").act(model_50_bn)'}, {'name': 'model_51_cv1_conv', 'operator': 'conv', 'users': 1, 'args': ['model_50_act'], 'calculate': 'getattr(self.model, "51").cv1.conv(model_50_act)'}, {'name': 'model_51_cv1_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv1_conv'], 'calculate': 'getattr(self.model, "51").cv1.bn(model_51_cv1_conv)'}, {'name': 'model_51_cv1_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv1_bn'], 'calculate': 'getattr(self.model, "51").cv1.act(model_51_cv1_bn)'}, {'name': 'model_51_cv3_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv1_act'], 'calculate': 'getattr(self.model, "51").cv3.conv(model_51_cv1_act)'}, {'name': 'model_51_cv3_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv3_conv'], 'calculate': 'getattr(self.model, "51").cv3.bn(model_51_cv3_conv)'}, {'name': 'model_51_cv3_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv3_bn'], 'calculate': 'getattr(self.model, "51").cv3.act(model_51_cv3_bn)'}, {'name': 'model_51_cv4_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv3_act'], 'calculate': 'getattr(self.model, "51").cv4.conv(model_51_cv3_act)'}, {'name': 'model_51_cv4_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv4_conv'], 'calculate': 'getattr(self.model, "51").cv4.bn(model_51_cv4_conv)'}, {'name': 'model_51_cv4_act', 'operator': 'act', 'users': 4, 'args': ['model_51_cv4_bn'], 'calculate': 'getattr(self.model, "51").cv4.act(model_51_cv4_bn)'}, {'name': 'model_51_m_0', 'operator': '0', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "0")(model_51_cv4_act)'}, {'name': 'model_51_m_1', 'operator': '1', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "1")(model_51_cv4_act)'}, {'name': 'model_51_m_2', 'operator': '2', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "2")(model_51_cv4_act)'}, {'name': 'cat_7', 'operator': '7', 'users': 1, 'args': ['model_51_cv4_act', 'model_51_m_0', 'model_51_m_1', 'model_51_m_2'], 'calculate': 'torch.cat([model_51_cv4_act, model_51_m_0, model_51_m_1, model_51_m_2], 1)'}, {'name': 'model_51_cv5_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_7'], 'calculate': 'getattr(self.model, "51").cv5.conv(cat_7)'}, {'name': 'model_51_cv5_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv5_conv'], 'calculate': 'getattr(self.model, "51").cv5.bn(model_51_cv5_conv)'}, {'name': 'model_51_cv5_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv5_bn'], 'calculate': 'getattr(self.model, "51").cv5.act(model_51_cv5_bn)'}, {'name': 'model_51_cv6_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv5_act'], 'calculate': 'getattr(self.model, "51").cv6.conv(model_51_cv5_act)'}, {'name': 'model_51_cv6_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv6_conv'], 'calculate': 'getattr(self.model, "51").cv6.bn(model_51_cv6_conv)'}, {'name': 'model_51_cv6_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv6_bn'], 'calculate': 'getattr(self.model, "51").cv6.act(model_51_cv6_bn)'}, {'name': 'model_51_cv2_conv', 'operator': 'conv', 'users': 1, 'args': ['model_50_act'], 'calculate': 'getattr(self.model, "51").cv2.conv(model_50_act)'}, {'name': 'model_51_cv2_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv2_conv'], 'calculate': 'getattr(self.model, "51").cv2.bn(model_51_cv2_conv)'}, {'name': 'model_51_cv2_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv2_bn'], 'calculate': 'getattr(self.model, "51").cv2.act(model_51_cv2_bn)'}, {'name': 'cat_8', 'operator': '8', 'users': 1, 'args': ['model_51_cv6_act', 'model_51_cv2_act'], 'calculate': 'torch.cat((model_51_cv6_act, model_51_cv2_act), dim'}, {'name': 'model_51_cv7_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_8'], 'calculate': 'getattr(self.model, "51").cv7.conv(cat_8)'}, {'name': 'model_51_cv7_bn', 'operator': 'bn', 'users': 1, 'args': ['model_51_cv7_conv'], 'calculate': 'getattr(self.model, "51").cv7.bn(model_51_cv7_conv)'}, {'name': 'model_51_cv7_act', 'operator': 'act', 'users': 2, 'args': ['model_51_cv7_bn'], 'calculate': 'getattr(self.model, "51").cv7.act(model_51_cv7_bn)'}, {'name': 'model_52_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv7_act'], 'calculate': 'getattr(self.model, "52").conv(model_51_cv7_act)'}, {'name': 'model_52_bn', 'operator': 'bn', 'users': 1, 'args': ['model_52_conv'], 'calculate': 'getattr(self.model, "52").bn(model_52_conv)'}, {'name': 'model_52_act', 'operator': 'act', 'users': 1, 'args': ['model_52_bn'], 'calculate': 'getattr(self.model, "52").act(model_52_bn)'}, {'name': 'model_53', 'operator': '53', 'users': 1, 'args': ['model_52_act'], 'calculate': 'getattr(self.model, "53")(model_52_act)'}, {'name': 'model_54_conv', 'operator': 'conv', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "54").conv(model_37_act)'}, {'name': 'model_54_bn', 'operator': 'bn', 'users': 1, 'args': ['model_54_conv'], 'calculate': 'getattr(self.model, "54").bn(model_54_conv)'}, {'name': 'model_54_act', 'operator': 'act', 'users': 1, 'args': ['model_54_bn'], 'calculate': 'getattr(self.model, "54").act(model_54_bn)'}, {'name': 'cat_9', 'operator': '9', 'users': 2, 'args': ['model_54_act', 'model_53'], 'calculate': 'torch.cat([model_54_act, model_53], 1)'}, {'name': 'model_56_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_9'], 'calculate': 'getattr(self.model, "56").conv(cat_9)'}, {'name': 'model_56_bn', 'operator': 'bn', 'users': 1, 'args': ['model_56_conv'], 'calculate': 'getattr(self.model, "56").bn(model_56_conv)'}, {'name': 'model_56_act', 'operator': 'act', 'users': 1, 'args': ['model_56_bn'], 'calculate': 'getattr(self.model, "56").act(model_56_bn)'}, {'name': 'model_57_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_9'], 'calculate': 'getattr(self.model, "57").conv(cat_9)'}, {'name': 'model_57_bn', 'operator': 'bn', 'users': 1, 'args': ['model_57_conv'], 'calculate': 'getattr(self.model, "57").bn(model_57_conv)'}, {'name': 'model_57_act', 'operator': 'act', 'users': 2, 'args': ['model_57_bn'], 'calculate': 'getattr(self.model, "57").act(model_57_bn)'}, {'name': 'model_58_conv', 'operator': 'conv', 'users': 1, 'args': ['model_57_act'], 'calculate': 'getattr(self.model, "58").conv(model_57_act)'}, {'name': 'model_58_bn', 'operator': 'bn', 'users': 1, 'args': ['model_58_conv'], 'calculate': 'getattr(self.model, "58").bn(model_58_conv)'}, {'name': 'model_58_act', 'operator': 'act', 'users': 2, 'args': ['model_58_bn'], 'calculate': 'getattr(self.model, "58").act(model_58_bn)'}, {'name': 'model_59_conv', 'operator': 'conv', 'users': 1, 'args': ['model_58_act'], 'calculate': 'getattr(self.model, "59").conv(model_58_act)'}, {'name': 'model_59_bn', 'operator': 'bn', 'users': 1, 'args': ['model_59_conv'], 'calculate': 'getattr(self.model, "59").bn(model_59_conv)'}, {'name': 'model_59_act', 'operator': 'act', 'users': 2, 'args': ['model_59_bn'], 'calculate': 'getattr(self.model, "59").act(model_59_bn)'}, {'name': 'model_60_conv', 'operator': 'conv', 'users': 1, 'args': ['model_59_act'], 'calculate': 'getattr(self.model, "60").conv(model_59_act)'}, {'name': 'model_60_bn', 'operator': 'bn', 'users': 1, 'args': ['model_60_conv'], 'calculate': 'getattr(self.model, "60").bn(model_60_conv)'}, {'name': 'model_60_act', 'operator': 'act', 'users': 2, 'args': ['model_60_bn'], 'calculate': 'getattr(self.model, "60").act(model_60_bn)'}, {'name': 'model_61_conv', 'operator': 'conv', 'users': 1, 'args': ['model_60_act'], 'calculate': 'getattr(self.model, "61").conv(model_60_act)'}, {'name': 'model_61_bn', 'operator': 'bn', 'users': 1, 'args': ['model_61_conv'], 'calculate': 'getattr(self.model, "61").bn(model_61_conv)'}, {'name': 'model_61_act', 'operator': 'act', 'users': 1, 'args': ['model_61_bn'], 'calculate': 'getattr(self.model, "61").act(model_61_bn)'}, {'name': 'cat_10', 'operator': '10', 'users': 1, 'args': ['model_61_act', 'model_60_act', 'model_59_act', 'model_58_act', 'model_57_act', 'model_56_act'], 'calculate': 'torch.cat([model_61_act, model_60_act, model_59_act, model_58_act, model_57_act, model_56_act], 1)'}, {'name': 'model_63_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_10'], 'calculate': 'getattr(self.model, "63").conv(cat_10)'}, {'name': 'model_63_bn', 'operator': 'bn', 'users': 1, 'args': ['model_63_conv'], 'calculate': 'getattr(self.model, "63").bn(model_63_conv)'}, {'name': 'model_63_act', 'operator': 'act', 'users': 2, 'args': ['model_63_bn'], 'calculate': 'getattr(self.model, "63").act(model_63_bn)'}, {'name': 'model_64_conv', 'operator': 'conv', 'users': 1, 'args': ['model_63_act'], 'calculate': 'getattr(self.model, "64").conv(model_63_act)'}, {'name': 'model_64_bn', 'operator': 'bn', 'users': 1, 'args': ['model_64_conv'], 'calculate': 'getattr(self.model, "64").bn(model_64_conv)'}, {'name': 'model_64_act', 'operator': 'act', 'users': 1, 'args': ['model_64_bn'], 'calculate': 'getattr(self.model, "64").act(model_64_bn)'}, {'name': 'model_65', 'operator': '65', 'users': 1, 'args': ['model_64_act'], 'calculate': 'getattr(self.model, "65")(model_64_act)'}, {'name': 'model_66_conv', 'operator': 'conv', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "66").conv(model_24_act)'}, {'name': 'model_66_bn', 'operator': 'bn', 'users': 1, 'args': ['model_66_conv'], 'calculate': 'getattr(self.model, "66").bn(model_66_conv)'}, {'name': 'model_66_act', 'operator': 'act', 'users': 1, 'args': ['model_66_bn'], 'calculate': 'getattr(self.model, "66").act(model_66_bn)'}, {'name': 'cat_11', 'operator': '11', 'users': 2, 'args': ['model_66_act', 'model_65'], 'calculate': 'torch.cat([model_66_act, model_65], 1)'}, {'name': 'model_68_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_11'], 'calculate': 'getattr(self.model, "68").conv(cat_11)'}, {'name': 'model_68_bn', 'operator': 'bn', 'users': 1, 'args': ['model_68_conv'], 'calculate': 'getattr(self.model, "68").bn(model_68_conv)'}, {'name': 'model_68_act', 'operator': 'act', 'users': 1, 'args': ['model_68_bn'], 'calculate': 'getattr(self.model, "68").act(model_68_bn)'}, {'name': 'model_69_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_11'], 'calculate': 'getattr(self.model, "69").conv(cat_11)'}, {'name': 'model_69_bn', 'operator': 'bn', 'users': 1, 'args': ['model_69_conv'], 'calculate': 'getattr(self.model, "69").bn(model_69_conv)'}, {'name': 'model_69_act', 'operator': 'act', 'users': 2, 'args': ['model_69_bn'], 'calculate': 'getattr(self.model, "69").act(model_69_bn)'}, {'name': 'model_70_conv', 'operator': 'conv', 'users': 1, 'args': ['model_69_act'], 'calculate': 'getattr(self.model, "70").conv(model_69_act)'}, {'name': 'model_70_bn', 'operator': 'bn', 'users': 1, 'args': ['model_70_conv'], 'calculate': 'getattr(self.model, "70").bn(model_70_conv)'}, {'name': 'model_70_act', 'operator': 'act', 'users': 2, 'args': ['model_70_bn'], 'calculate': 'getattr(self.model, "70").act(model_70_bn)'}, {'name': 'model_71_conv', 'operator': 'conv', 'users': 1, 'args': ['model_70_act'], 'calculate': 'getattr(self.model, "71").conv(model_70_act)'}, {'name': 'model_71_bn', 'operator': 'bn', 'users': 1, 'args': ['model_71_conv'], 'calculate': 'getattr(self.model, "71").bn(model_71_conv)'}, {'name': 'model_71_act', 'operator': 'act', 'users': 2, 'args': ['model_71_bn'], 'calculate': 'getattr(self.model, "71").act(model_71_bn)'}, {'name': 'model_72_conv', 'operator': 'conv', 'users': 1, 'args': ['model_71_act'], 'calculate': 'getattr(self.model, "72").conv(model_71_act)'}, {'name': 'model_72_bn', 'operator': 'bn', 'users': 1, 'args': ['model_72_conv'], 'calculate': 'getattr(self.model, "72").bn(model_72_conv)'}, {'name': 'model_72_act', 'operator': 'act', 'users': 2, 'args': ['model_72_bn'], 'calculate': 'getattr(self.model, "72").act(model_72_bn)'}, {'name': 'model_73_conv', 'operator': 'conv', 'users': 1, 'args': ['model_72_act'], 'calculate': 'getattr(self.model, "73").conv(model_72_act)'}, {'name': 'model_73_bn', 'operator': 'bn', 'users': 1, 'args': ['model_73_conv'], 'calculate': 'getattr(self.model, "73").bn(model_73_conv)'}, {'name': 'model_73_act', 'operator': 'act', 'users': 1, 'args': ['model_73_bn'], 'calculate': 'getattr(self.model, "73").act(model_73_bn)'}, {'name': 'cat_12', 'operator': '12', 'users': 1, 'args': ['model_73_act', 'model_72_act', 'model_71_act', 'model_70_act', 'model_69_act', 'model_68_act'], 'calculate': 'torch.cat([model_73_act, model_72_act, model_71_act, model_70_act, model_69_act, model_68_act], 1)'}, {'name': 'model_75_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_12'], 'calculate': 'getattr(self.model, "75").conv(cat_12)'}, {'name': 'model_75_bn', 'operator': 'bn', 'users': 1, 'args': ['model_75_conv'], 'calculate': 'getattr(self.model, "75").bn(model_75_conv)'}, {'name': 'model_75_act', 'operator': 'act', 'users': 4, 'args': ['model_75_bn'], 'calculate': 'getattr(self.model, "75").act(model_75_bn)'}, {'name': 'model_76_m', 'operator': 'm', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(self.model, "76").m(model_75_act)'}, {'name': 'model_77_conv', 'operator': 'conv', 'users': 1, 'args': ['model_76_m'], 'calculate': 'getattr(self.model, "77").conv(model_76_m)'}, {'name': 'model_77_bn', 'operator': 'bn', 'users': 1, 'args': ['model_77_conv'], 'calculate': 'getattr(self.model, "77").bn(model_77_conv)'}, {'name': 'model_77_act', 'operator': 'act', 'users': 1, 'args': ['model_77_bn'], 'calculate': 'getattr(self.model, "77").act(model_77_bn)'}, {'name': 'model_78_conv', 'operator': 'conv', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(self.model, "78").conv(model_75_act)'}, {'name': 'model_78_bn', 'operator': 'bn', 'users': 1, 'args': ['model_78_conv'], 'calculate': 'getattr(self.model, "78").bn(model_78_conv)'}, {'name': 'model_78_act', 'operator': 'act', 'users': 1, 'args': ['model_78_bn'], 'calculate': 'getattr(self.model, "78").act(model_78_bn)'}, {'name': 'model_79_conv', 'operator': 'conv', 'users': 1, 'args': ['model_78_act'], 'calculate': 'getattr(self.model, "79").conv(model_78_act)'}, {'name': 'model_79_bn', 'operator': 'bn', 'users': 1, 'args': ['model_79_conv'], 'calculate': 'getattr(self.model, "79").bn(model_79_conv)'}, {'name': 'model_79_act', 'operator': 'act', 'users': 1, 'args': ['model_79_bn'], 'calculate': 'getattr(self.model, "79").act(model_79_bn)'}, {'name': 'cat_13', 'operator': '13', 'users': 2, 'args': ['model_79_act', 'model_77_act', 'model_63_act'], 'calculate': 'torch.cat([model_79_act, model_77_act, model_63_act], 1)'}, {'name': 'model_81_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_13'], 'calculate': 'getattr(self.model, "81").conv(cat_13)'}, {'name': 'model_81_bn', 'operator': 'bn', 'users': 1, 'args': ['model_81_conv'], 'calculate': 'getattr(self.model, "81").bn(model_81_conv)'}, {'name': 'model_81_act', 'operator': 'act', 'users': 1, 'args': ['model_81_bn'], 'calculate': 'getattr(self.model, "81").act(model_81_bn)'}, {'name': 'model_82_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_13'], 'calculate': 'getattr(self.model, "82").conv(cat_13)'}, {'name': 'model_82_bn', 'operator': 'bn', 'users': 1, 'args': ['model_82_conv'], 'calculate': 'getattr(self.model, "82").bn(model_82_conv)'}, {'name': 'model_82_act', 'operator': 'act', 'users': 2, 'args': ['model_82_bn'], 'calculate': 'getattr(self.model, "82").act(model_82_bn)'}, {'name': 'model_83_conv', 'operator': 'conv', 'users': 1, 'args': ['model_82_act'], 'calculate': 'getattr(self.model, "83").conv(model_82_act)'}, {'name': 'model_83_bn', 'operator': 'bn', 'users': 1, 'args': ['model_83_conv'], 'calculate': 'getattr(self.model, "83").bn(model_83_conv)'}, {'name': 'model_83_act', 'operator': 'act', 'users': 2, 'args': ['model_83_bn'], 'calculate': 'getattr(self.model, "83").act(model_83_bn)'}, {'name': 'model_84_conv', 'operator': 'conv', 'users': 1, 'args': ['model_83_act'], 'calculate': 'getattr(self.model, "84").conv(model_83_act)'}, {'name': 'model_84_bn', 'operator': 'bn', 'users': 1, 'args': ['model_84_conv'], 'calculate': 'getattr(self.model, "84").bn(model_84_conv)'}, {'name': 'model_84_act', 'operator': 'act', 'users': 2, 'args': ['model_84_bn'], 'calculate': 'getattr(self.model, "84").act(model_84_bn)'}, {'name': 'model_85_conv', 'operator': 'conv', 'users': 1, 'args': ['model_84_act'], 'calculate': 'getattr(self.model, "85").conv(model_84_act)'}, {'name': 'model_85_bn', 'operator': 'bn', 'users': 1, 'args': ['model_85_conv'], 'calculate': 'getattr(self.model, "85").bn(model_85_conv)'}, {'name': 'model_85_act', 'operator': 'act', 'users': 2, 'args': ['model_85_bn'], 'calculate': 'getattr(self.model, "85").act(model_85_bn)'}, {'name': 'model_86_conv', 'operator': 'conv', 'users': 1, 'args': ['model_85_act'], 'calculate': 'getattr(self.model, "86").conv(model_85_act)'}, {'name': 'model_86_bn', 'operator': 'bn', 'users': 1, 'args': ['model_86_conv'], 'calculate': 'getattr(self.model, "86").bn(model_86_conv)'}, {'name': 'model_86_act', 'operator': 'act', 'users': 1, 'args': ['model_86_bn'], 'calculate': 'getattr(self.model, "86").act(model_86_bn)'}, {'name': 'cat_14', 'operator': '14', 'users': 1, 'args': ['model_86_act', 'model_85_act', 'model_84_act', 'model_83_act', 'model_82_act', 'model_81_act'], 'calculate': 'torch.cat([model_86_act, model_85_act, model_84_act, model_83_act, model_82_act, model_81_act], 1)'}, {'name': 'model_88_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_14'], 'calculate': 'getattr(self.model, "88").conv(cat_14)'}, {'name': 'model_88_bn', 'operator': 'bn', 'users': 1, 'args': ['model_88_conv'], 'calculate': 'getattr(self.model, "88").bn(model_88_conv)'}, {'name': 'model_88_act', 'operator': 'act', 'users': 4, 'args': ['model_88_bn'], 'calculate': 'getattr(self.model, "88").act(model_88_bn)'}, {'name': 'model_89_m', 'operator': 'm', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(self.model, "89").m(model_88_act)'}, {'name': 'model_90_conv', 'operator': 'conv', 'users': 1, 'args': ['model_89_m'], 'calculate': 'getattr(self.model, "90").conv(model_89_m)'}, {'name': 'model_90_bn', 'operator': 'bn', 'users': 1, 'args': ['model_90_conv'], 'calculate': 'getattr(self.model, "90").bn(model_90_conv)'}, {'name': 'model_90_act', 'operator': 'act', 'users': 1, 'args': ['model_90_bn'], 'calculate': 'getattr(self.model, "90").act(model_90_bn)'}, {'name': 'model_91_conv', 'operator': 'conv', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(self.model, "91").conv(model_88_act)'}, {'name': 'model_91_bn', 'operator': 'bn', 'users': 1, 'args': ['model_91_conv'], 'calculate': 'getattr(self.model, "91").bn(model_91_conv)'}, {'name': 'model_91_act', 'operator': 'act', 'users': 1, 'args': ['model_91_bn'], 'calculate': 'getattr(self.model, "91").act(model_91_bn)'}, {'name': 'model_92_conv', 'operator': 'conv', 'users': 1, 'args': ['model_91_act'], 'calculate': 'getattr(self.model, "92").conv(model_91_act)'}, {'name': 'model_92_bn', 'operator': 'bn', 'users': 1, 'args': ['model_92_conv'], 'calculate': 'getattr(self.model, "92").bn(model_92_conv)'}, {'name': 'model_92_act', 'operator': 'act', 'users': 1, 'args': ['model_92_bn'], 'calculate': 'getattr(self.model, "92").act(model_92_bn)'}, {'name': 'cat_15', 'operator': '15', 'users': 2, 'args': ['model_92_act', 'model_90_act', 'model_51_cv7_act'], 'calculate': 'torch.cat([model_92_act, model_90_act, model_51_cv7_act], 1)'}, {'name': 'model_94_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_15'], 'calculate': 'getattr(self.model, "94").conv(cat_15)'}, {'name': 'model_94_bn', 'operator': 'bn', 'users': 1, 'args': ['model_94_conv'], 'calculate': 'getattr(self.model, "94").bn(model_94_conv)'}, {'name': 'model_94_act', 'operator': 'act', 'users': 1, 'args': ['model_94_bn'], 'calculate': 'getattr(self.model, "94").act(model_94_bn)'}, {'name': 'model_95_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_15'], 'calculate': 'getattr(self.model, "95").conv(cat_15)'}, {'name': 'model_95_bn', 'operator': 'bn', 'users': 1, 'args': ['model_95_conv'], 'calculate': 'getattr(self.model, "95").bn(model_95_conv)'}, {'name': 'model_95_act', 'operator': 'act', 'users': 2, 'args': ['model_95_bn'], 'calculate': 'getattr(self.model, "95").act(model_95_bn)'}, {'name': 'model_96_conv', 'operator': 'conv', 'users': 1, 'args': ['model_95_act'], 'calculate': 'getattr(self.model, "96").conv(model_95_act)'}, {'name': 'model_96_bn', 'operator': 'bn', 'users': 1, 'args': ['model_96_conv'], 'calculate': 'getattr(self.model, "96").bn(model_96_conv)'}, {'name': 'model_96_act', 'operator': 'act', 'users': 2, 'args': ['model_96_bn'], 'calculate': 'getattr(self.model, "96").act(model_96_bn)'}, {'name': 'model_97_conv', 'operator': 'conv', 'users': 1, 'args': ['model_96_act'], 'calculate': 'getattr(self.model, "97").conv(model_96_act)'}, {'name': 'model_97_bn', 'operator': 'bn', 'users': 1, 'args': ['model_97_conv'], 'calculate': 'getattr(self.model, "97").bn(model_97_conv)'}, {'name': 'model_97_act', 'operator': 'act', 'users': 2, 'args': ['model_97_bn'], 'calculate': 'getattr(self.model, "97").act(model_97_bn)'}, {'name': 'model_98_conv', 'operator': 'conv', 'users': 1, 'args': ['model_97_act'], 'calculate': 'getattr(self.model, "98").conv(model_97_act)'}, {'name': 'model_98_bn', 'operator': 'bn', 'users': 1, 'args': ['model_98_conv'], 'calculate': 'getattr(self.model, "98").bn(model_98_conv)'}, {'name': 'model_98_act', 'operator': 'act', 'users': 2, 'args': ['model_98_bn'], 'calculate': 'getattr(self.model, "98").act(model_98_bn)'}, {'name': 'model_99_conv', 'operator': 'conv', 'users': 1, 'args': ['model_98_act'], 'calculate': 'getattr(self.model, "99").conv(model_98_act)'}, {'name': 'model_99_bn', 'operator': 'bn', 'users': 1, 'args': ['model_99_conv'], 'calculate': 'getattr(self.model, "99").bn(model_99_conv)'}, {'name': 'model_99_act', 'operator': 'act', 'users': 1, 'args': ['model_99_bn'], 'calculate': 'getattr(self.model, "99").act(model_99_bn)'}, {'name': 'cat_16', 'operator': '16', 'users': 1, 'args': ['model_99_act', 'model_98_act', 'model_97_act', 'model_96_act', 'model_95_act', 'model_94_act'], 'calculate': 'torch.cat([model_99_act, model_98_act, model_97_act, model_96_act, model_95_act, model_94_act], 1)'}, {'name': 'model_101_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_16'], 'calculate': 'getattr(self.model, "101").conv(cat_16)'}, {'name': 'model_101_bn', 'operator': 'bn', 'users': 1, 'args': ['model_101_conv'], 'calculate': 'getattr(self.model, "101").bn(model_101_conv)'}, {'name': 'model_101_act', 'operator': 'act', 'users': 2, 'args': ['model_101_bn'], 'calculate': 'getattr(self.model, "101").act(model_101_bn)'}, {'name': 'model_102_rbr_dense_0', 'operator': '0', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(getattr(self.model, "102").rbr_dense, "0")(model_75_act)'}, {'name': 'model_102_rbr_dense_1', 'operator': '1', 'users': 1, 'args': ['model_102_rbr_dense_0'], 'calculate': 'getattr(getattr(self.model, "102").rbr_dense, "1")(model_102_rbr_dense_0)'}, {'name': 'model_102_rbr_1x1_0', 'operator': '0', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(getattr(self.model, "102").rbr_1x1, "0")(model_75_act)'}, {'name': 'model_102_rbr_1x1_1', 'operator': '1', 'users': 1, 'args': ['model_102_rbr_1x1_0'], 'calculate': 'getattr(getattr(self.model, "102").rbr_1x1, "1")(model_102_rbr_1x1_0)'}, {'name': 'add', 'operator': 'add', 'users': 1, 'args': ['model_102_rbr_dense_1', 'model_102_rbr_1x1_1'], 'calculate': 'model_102_rbr_dense_1 + model_102_rbr_1x1_1'}, {'name': 'add_1', 'operator': '1', 'users': 1, 'args': ['add', '0'], 'calculate': 'add + 0'}, {'name': 'model_102_act', 'operator': 'act', 'users': 1, 'args': ['add_1'], 'calculate': 'getattr(self.model, "102").act(add_1)'}, {'name': 'model_103_rbr_dense_0', 'operator': '0', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(getattr(self.model, "103").rbr_dense, "0")(model_88_act)'}, {'name': 'model_103_rbr_dense_1', 'operator': '1', 'users': 1, 'args': ['model_103_rbr_dense_0'], 'calculate': 'getattr(getattr(self.model, "103").rbr_dense, "1")(model_103_rbr_dense_0)'}, {'name': 'model_103_rbr_1x1_0', 'operator': '0', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(getattr(self.model, "103").rbr_1x1, "0")(model_88_act)'}, {'name': 'model_103_rbr_1x1_1', 'operator': '1', 'users': 1, 'args': ['model_103_rbr_1x1_0'], 'calculate': 'getattr(getattr(self.model, "103").rbr_1x1, "1")(model_103_rbr_1x1_0)'}, {'name': 'add_2', 'operator': '2', 'users': 1, 'args': ['model_103_rbr_dense_1', 'model_103_rbr_1x1_1'], 'calculate': 'model_103_rbr_dense_1 + model_103_rbr_1x1_1'}, {'name': 'add_3', 'operator': '3', 'users': 1, 'args': ['add_2', '0'], 'calculate': 'add_2 + 0'}, {'name': 'model_103_act', 'operator': 'act', 'users': 1, 'args': ['add_3'], 'calculate': 'getattr(self.model, "103").act(add_3)'}, {'name': 'model_104_rbr_dense_0', 'operator': '0', 'users': 1, 'args': ['model_101_act'], 'calculate': 'getattr(getattr(self.model, "104").rbr_dense, "0")(model_101_act)'}, {'name': 'model_104_rbr_dense_1', 'operator': '1', 'users': 1, 'args': ['model_104_rbr_dense_0'], 'calculate': 'getattr(getattr(self.model, "104").rbr_dense, "1")(model_104_rbr_dense_0)'}, {'name': 'model_104_rbr_1x1_0', 'operator': '0', 'users': 1, 'args': ['model_101_act'], 'calculate': 'getattr(getattr(self.model, "104").rbr_1x1, "0")(model_101_act)'}, {'name': 'model_104_rbr_1x1_1', 'operator': '1', 'users': 1, 'args': ['model_104_rbr_1x1_0'], 'calculate': 'getattr(getattr(self.model, "104").rbr_1x1, "1")(model_104_rbr_1x1_0)'}, {'name': 'add_4', 'operator': '4', 'users': 1, 'args': ['model_104_rbr_dense_1', 'model_104_rbr_1x1_1'], 'calculate': 'model_104_rbr_dense_1 + model_104_rbr_1x1_1'}, {'name': 'add_5', 'operator': '5', 'users': 1, 'args': ['add_4', '0'], 'calculate': 'add_4 + 0'}, {'name': 'model_104_act', 'operator': 'act', 'users': 1, 'args': ['add_5'], 'calculate': 'getattr(self.model, "104").act(add_5)'}, {'name': 'model_105_ia_0_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").ia, "0").implicit'}, {'name': 'add_6', 'operator': '6', 'users': 1, 'args': ['model_105_ia_0_implicit', 'model_102_act'], 'calculate': 'model_105_ia_0_implicit + model_102_act'}, {'name': 'model_105_m_0', 'operator': '0', 'users': 1, 'args': ['add_6'], 'calculate': 'getattr(getattr(self.model, "105").m, "0")(add_6)'}, {'name': 'model_105_im_0_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").im, "0").implicit'}, {'name': 'mul', 'operator': 'mul', 'users': 2, 'args': ['model_105_im_0_implicit', 'model_105_m_0'], 'calculate': 'model_105_im_0_implicit * model_105_m_0'}, {'name': 'getattr_1', 'operator': '1', 'users': 4, 'args': ['mul', 'shape'], 'calculate': 'mul.shape'}, {'name': 'getitem', 'operator': 'getitem', 'users': 1, 'args': ['getattr_1', '0'], 'calculate': 'getattr_1[0]'}, {'name': 'getitem_2', 'operator': '2', 'users': 1, 'args': ['getattr_1', '2'], 'calculate': 'getattr_1[2]'}, {'name': 'getitem_3', 'operator': '3', 'users': 1, 'args': ['getattr_1', '3'], 'calculate': 'getattr_1[3]'}, {'name': 'view', 'operator': 'view', 'users': 1, 'args': ['mul', 'getitem', '3', '85', 'getitem_2', 'getitem_3'], 'calculate': 'mul.view(getitem, 3, 85, getitem_2, getitem_3)'}, {'name': 'permute', 'operator': 'permute', 'users': 1, 'args': ['view', '0', '1', '3', '4', '2'], 'calculate': 'view.permute(0, 1, 3, 4, 2)'}, {'name': 'contiguous', 'operator': 'contiguous', 'users': 1, 'args': ['permute'], 'calculate': 'permute.contiguous()'}, {'name': 'model_105_ia_1_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").ia, "1").implicit'}, {'name': 'add_7', 'operator': '7', 'users': 1, 'args': ['model_105_ia_1_implicit', 'model_103_act'], 'calculate': 'model_105_ia_1_implicit + model_103_act'}, {'name': 'model_105_m_1', 'operator': '1', 'users': 1, 'args': ['add_7'], 'calculate': 'getattr(getattr(self.model, "105").m, "1")(add_7)'}, {'name': 'model_105_im_1_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").im, "1").implicit'}, {'name': 'mul_1', 'operator': '1', 'users': 2, 'args': ['model_105_im_1_implicit', 'model_105_m_1'], 'calculate': 'model_105_im_1_implicit * model_105_m_1'}, {'name': 'getattr_2', 'operator': '2', 'users': 4, 'args': ['mul_1', 'shape'], 'calculate': 'mul_1.shape'}, {'name': 'getitem_4', 'operator': '4', 'users': 1, 'args': ['getattr_2', '0'], 'calculate': 'getattr_2[0]'}, {'name': 'getitem_6', 'operator': '6', 'users': 1, 'args': ['getattr_2', '2'], 'calculate': 'getattr_2[2]'}, {'name': 'getitem_7', 'operator': '7', 'users': 1, 'args': ['getattr_2', '3'], 'calculate': 'getattr_2[3]'}, {'name': 'view_1', 'operator': '1', 'users': 1, 'args': ['mul_1', 'getitem_4', '3', '85', 'getitem_6', 'getitem_7'], 'calculate': 'mul_1.view(getitem_4, 3, 85, getitem_6, getitem_7)'}, {'name': 'permute_1', 'operator': '1', 'users': 1, 'args': ['view_1', '0', '1', '3', '4', '2'], 'calculate': 'view_1.permute(0, 1, 3, 4, 2)'}, {'name': 'contiguous_1', 'operator': '1', 'users': 1, 'args': ['permute_1'], 'calculate': 'permute_1.contiguous()'}, {'name': 'model_105_ia_2_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").ia, "2").implicit'}, {'name': 'add_8', 'operator': '8', 'users': 1, 'args': ['model_105_ia_2_implicit', 'model_104_act'], 'calculate': 'model_105_ia_2_implicit + model_104_act'}, {'name': 'model_105_m_2', 'operator': '2', 'users': 1, 'args': ['add_8'], 'calculate': 'getattr(getattr(self.model, "105").m, "2")(add_8)'}, {'name': 'model_105_im_2_implicit', 'operator': 'implicit', 'users': 1, 'args': None, 'calculate': 'getattr(getattr(self.model, "105").im, "2").implicit'}, {'name': 'mul_2', 'operator': '2', 'users': 2, 'args': ['model_105_im_2_implicit', 'model_105_m_2'], 'calculate': 'model_105_im_2_implicit * model_105_m_2'}, {'name': 'getattr_3', 'operator': '3', 'users': 4, 'args': ['mul_2', 'shape'], 'calculate': 'mul_2.shape'}, {'name': 'getitem_8', 'operator': '8', 'users': 1, 'args': ['getattr_3', '0'], 'calculate': 'getattr_3[0]'}, {'name': 'getitem_10', 'operator': '10', 'users': 1, 'args': ['getattr_3', '2'], 'calculate': 'getattr_3[2]'}, {'name': 'getitem_11', 'operator': '11', 'users': 1, 'args': ['getattr_3', '3'], 'calculate': 'getattr_3[3]'}, {'name': 'view_2', 'operator': '2', 'users': 1, 'args': ['mul_2', 'getitem_8', '3', '85', 'getitem_10', 'getitem_11'], 'calculate': 'mul_2.view(getitem_8, 3, 85, getitem_10, getitem_11)'}, {'name': 'permute_2', 'operator': '2', 'users': 1, 'args': ['view_2', '0', '1', '3', '4', '2'], 'calculate': 'view_2.permute(0, 1, 3, 4, 2)'}, {'name': 'contiguous_2', 'operator': '2', 'users': 1, 'args': ['permute_2'], 'calculate': 'permute_2.contiguous()'}]
from torch.fx import symbolic_trace
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from matplotlib import pyplot as plt
import networkx as nx
import pandas as pd
import re
class Draw_G:
def __init__(self):
# self.model = model
# self.gm = symbolic_trace(model)
# self.nodes = self.getnodes()
self.nodes = [{'name': 'model_0_conv', 'operator': 'conv', 'users': 1, 'args': [], 'calculate': 'getattr(self.model, "0").conv(x)'}, {'name': 'model_0_act', 'operator': 'act', 'users': 1, 'args': ['model_0_conv'], 'calculate': 'getattr(self.model, "0").act(model_0_conv)'}, {'name': 'model_1_conv', 'operator': 'conv', 'users': 1, 'args': ['model_0_act'], 'calculate': 'getattr(self.model, "1").conv(model_0_act)'}, {'name': 'model_1_act', 'operator': 'act', 'users': 1, 'args': ['model_1_conv'], 'calculate': 'getattr(self.model, "1").act(model_1_conv)'}, {'name': 'model_2_conv', 'operator': 'conv', 'users': 1, 'args': ['model_1_act'], 'calculate': 'getattr(self.model, "2").conv(model_1_act)'}, {'name': 'model_2_act', 'operator': 'act', 'users': 1, 'args': ['model_2_conv'], 'calculate': 'getattr(self.model, "2").act(model_2_conv)'}, {'name': 'model_3_conv', 'operator': 'conv', 'users': 1, 'args': ['model_2_act'], 'calculate': 'getattr(self.model, "3").conv(model_2_act)'}, {'name': 'model_3_act', 'operator': 'act', 'users': 2, 'args': ['model_3_conv'], 'calculate': 'getattr(self.model, "3").act(model_3_conv)'}, {'name': 'model_4_conv', 'operator': 'conv', 'users': 1, 'args': ['model_3_act'], 'calculate': 'getattr(self.model, "4").conv(model_3_act)'}, {'name': 'model_4_act', 'operator': 'act', 'users': 1, 'args': ['model_4_conv'], 'calculate': 'getattr(self.model, "4").act(model_4_conv)'}, {'name': 'model_5_conv', 'operator': 'conv', 'users': 1, 'args': ['model_3_act'], 'calculate': 'getattr(self.model, "5").conv(model_3_act)'}, {'name': 'model_5_act', 'operator': 'act', 'users': 2, 'args': ['model_5_conv'], 'calculate': 'getattr(self.model, "5").act(model_5_conv)'}, {'name': 'model_6_conv', 'operator': 'conv', 'users': 1, 'args': ['model_5_act'], 'calculate': 'getattr(self.model, "6").conv(model_5_act)'}, {'name': 'model_6_act', 'operator': 'act', 'users': 1, 'args': ['model_6_conv'], 'calculate': 'getattr(self.model, "6").act(model_6_conv)'}, {'name': 'model_7_conv', 'operator': 'conv', 'users': 1, 'args': ['model_6_act'], 'calculate': 'getattr(self.model, "7").conv(model_6_act)'}, {'name': 'model_7_act', 'operator': 'act', 'users': 2, 'args': ['model_7_conv'], 'calculate': 'getattr(self.model, "7").act(model_7_conv)'}, {'name': 'model_8_conv', 'operator': 'conv', 'users': 1, 'args': ['model_7_act'], 'calculate': 'getattr(self.model, "8").conv(model_7_act)'}, {'name': 'model_8_act', 'operator': 'act', 'users': 1, 'args': ['model_8_conv'], 'calculate': 'getattr(self.model, "8").act(model_8_conv)'}, {'name': 'model_9_conv', 'operator': 'conv', 'users': 1, 'args': ['model_8_act'], 'calculate': 'getattr(self.model, "9").conv(model_8_act)'}, {'name': 'model_9_act', 'operator': 'act', 'users': 1, 'args': ['model_9_conv'], 'calculate': 'getattr(self.model, "9").act(model_9_conv)'}, {'name': 'cat', 'operator': 'cat', 'users': 1, 'args': ['model_9_act', 'model_7_act', 'model_5_act', 'model_4_act'], 'calculate': 'torch.cat([model_9_act, model_7_act, model_5_act, model_4_act], 1)'}, {'name': 'model_11_conv', 'operator': 'conv', 'users': 1, 'args': ['cat'], 'calculate': 'getattr(self.model, "11").conv(cat)'}, {'name': 'model_11_act', 'operator': 'act', 'users': 2, 'args': ['model_11_conv'], 'calculate': 'getattr(self.model, "11").act(model_11_conv)'}, {'name': 'model_12_m', 'operator': 'm', 'users': 1, 'args': ['model_11_act'], 'calculate': 'getattr(self.model, "12").m(model_11_act)'}, {'name': 'model_13_conv', 'operator': 'conv', 'users': 1, 'args': ['model_12_m'], 'calculate': 'getattr(self.model, "13").conv(model_12_m)'}, {'name': 'model_13_act', 'operator': 'act', 'users': 1, 'args': ['model_13_conv'], 'calculate': 'getattr(self.model, "13").act(model_13_conv)'}, {'name': 'model_14_conv', 'operator': 'conv', 'users': 1, 'args': ['model_11_act'], 'calculate': 'getattr(self.model, "14").conv(model_11_act)'}, {'name': 'model_14_act', 'operator': 'act', 'users': 1, 'args': ['model_14_conv'], 'calculate': 'getattr(self.model, "14").act(model_14_conv)'}, {'name': 'model_15_conv', 'operator': 'conv', 'users': 1, 'args': ['model_14_act'], 'calculate': 'getattr(self.model, "15").conv(model_14_act)'}, {'name': 'model_15_act', 'operator': 'act', 'users': 1, 'args': ['model_15_conv'], 'calculate': 'getattr(self.model, "15").act(model_15_conv)'}, {'name': 'cat_1', 'operator': '1', 'users': 2, 'args': ['model_15_act', 'model_13_act'], 'calculate': 'torch.cat([model_15_act, model_13_act], 1)'}, {'name': 'model_17_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_1'], 'calculate': 'getattr(self.model, "17").conv(cat_1)'}, {'name': 'model_17_act', 'operator': 'act', 'users': 1, 'args': ['model_17_conv'], 'calculate': 'getattr(self.model, "17").act(model_17_conv)'}, {'name': 'model_18_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_1'], 'calculate': 'getattr(self.model, "18").conv(cat_1)'}, {'name': 'model_18_act', 'operator': 'act', 'users': 2, 'args': ['model_18_conv'], 'calculate': 'getattr(self.model, "18").act(model_18_conv)'}, {'name': 'model_19_conv', 'operator': 'conv', 'users': 1, 'args': ['model_18_act'], 'calculate': 'getattr(self.model, "19").conv(model_18_act)'}, {'name': 'model_19_act', 'operator': 'act', 'users': 1, 'args': ['model_19_conv'], 'calculate': 'getattr(self.model, "19").act(model_19_conv)'}, {'name': 'model_20_conv', 'operator': 'conv', 'users': 1, 'args': ['model_19_act'], 'calculate': 'getattr(self.model, "20").conv(model_19_act)'}, {'name': 'model_20_act', 'operator': 'act', 'users': 2, 'args': ['model_20_conv'], 'calculate': 'getattr(self.model, "20").act(model_20_conv)'}, {'name': 'model_21_conv', 'operator': 'conv', 'users': 1, 'args': ['model_20_act'], 'calculate': 'getattr(self.model, "21").conv(model_20_act)'}, {'name': 'model_21_act', 'operator': 'act', 'users': 1, 'args': ['model_21_conv'], 'calculate': 'getattr(self.model, "21").act(model_21_conv)'}, {'name': 'model_22_conv', 'operator': 'conv', 'users': 1, 'args': ['model_21_act'], 'calculate': 'getattr(self.model, "22").conv(model_21_act)'}, {'name': 'model_22_act', 'operator': 'act', 'users': 1, 'args': ['model_22_conv'], 'calculate': 'getattr(self.model, "22").act(model_22_conv)'}, {'name': 'cat_2', 'operator': '2', 'users': 1, 'args': ['model_22_act', 'model_20_act', 'model_18_act', 'model_17_act'], 'calculate': 'torch.cat([model_22_act, model_20_act, model_18_act, model_17_act], 1)'}, {'name': 'model_24_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_2'], 'calculate': 'getattr(self.model, "24").conv(cat_2)'}, {'name': 'model_24_act', 'operator': 'act', 'users': 3, 'args': ['model_24_conv'], 'calculate': 'getattr(self.model, "24").act(model_24_conv)'}, {'name': 'model_25_m', 'operator': 'm', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "25").m(model_24_act)'}, {'name': 'model_26_conv', 'operator': 'conv', 'users': 1, 'args': ['model_25_m'], 'calculate': 'getattr(self.model, "26").conv(model_25_m)'}, {'name': 'model_26_act', 'operator': 'act', 'users': 1, 'args': ['model_26_conv'], 'calculate': 'getattr(self.model, "26").act(model_26_conv)'}, {'name': 'model_27_conv', 'operator': 'conv', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "27").conv(model_24_act)'}, {'name': 'model_27_act', 'operator': 'act', 'users': 1, 'args': ['model_27_conv'], 'calculate': 'getattr(self.model, "27").act(model_27_conv)'}, {'name': 'model_28_conv', 'operator': 'conv', 'users': 1, 'args': ['model_27_act'], 'calculate': 'getattr(self.model, "28").conv(model_27_act)'}, {'name': 'model_28_act', 'operator': 'act', 'users': 1, 'args': ['model_28_conv'], 'calculate': 'getattr(self.model, "28").act(model_28_conv)'}, {'name': 'cat_3', 'operator': '3', 'users': 2, 'args': ['model_28_act', 'model_26_act'], 'calculate': 'torch.cat([model_28_act, model_26_act], 1)'}, {'name': 'model_30_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_3'], 'calculate': 'getattr(self.model, "30").conv(cat_3)'}, {'name': 'model_30_act', 'operator': 'act', 'users': 1, 'args': ['model_30_conv'], 'calculate': 'getattr(self.model, "30").act(model_30_conv)'}, {'name': 'model_31_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_3'], 'calculate': 'getattr(self.model, "31").conv(cat_3)'}, {'name': 'model_31_act', 'operator': 'act', 'users': 2, 'args': ['model_31_conv'], 'calculate': 'getattr(self.model, "31").act(model_31_conv)'}, {'name': 'model_32_conv', 'operator': 'conv', 'users': 1, 'args': ['model_31_act'], 'calculate': 'getattr(self.model, "32").conv(model_31_act)'}, {'name': 'model_32_act', 'operator': 'act', 'users': 1, 'args': ['model_32_conv'], 'calculate': 'getattr(self.model, "32").act(model_32_conv)'}, {'name': 'model_33_conv', 'operator': 'conv', 'users': 1, 'args': ['model_32_act'], 'calculate': 'getattr(self.model, "33").conv(model_32_act)'}, {'name': 'model_33_act', 'operator': 'act', 'users': 2, 'args': ['model_33_conv'], 'calculate': 'getattr(self.model, "33").act(model_33_conv)'}, {'name': 'model_34_conv', 'operator': 'conv', 'users': 1, 'args': ['model_33_act'], 'calculate': 'getattr(self.model, "34").conv(model_33_act)'}, {'name': 'model_34_act', 'operator': 'act', 'users': 1, 'args': ['model_34_conv'], 'calculate': 'getattr(self.model, "34").act(model_34_conv)'}, {'name': 'model_35_conv', 'operator': 'conv', 'users': 1, 'args': ['model_34_act'], 'calculate': 'getattr(self.model, "35").conv(model_34_act)'}, {'name': 'model_35_act', 'operator': 'act', 'users': 1, 'args': ['model_35_conv'], 'calculate': 'getattr(self.model, "35").act(model_35_conv)'}, {'name': 'cat_4', 'operator': '4', 'users': 1, 'args': ['model_35_act', 'model_33_act', 'model_31_act', 'model_30_act'], 'calculate': 'torch.cat([model_35_act, model_33_act, model_31_act, model_30_act], 1)'}, {'name': 'model_37_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_4'], 'calculate': 'getattr(self.model, "37").conv(cat_4)'}, {'name': 'model_37_act', 'operator': 'act', 'users': 3, 'args': ['model_37_conv'], 'calculate': 'getattr(self.model, "37").act(model_37_conv)'}, {'name': 'model_38_m', 'operator': 'm', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "38").m(model_37_act)'}, {'name': 'model_39_conv', 'operator': 'conv', 'users': 1, 'args': ['model_38_m'], 'calculate': 'getattr(self.model, "39").conv(model_38_m)'}, {'name': 'model_39_act', 'operator': 'act', 'users': 1, 'args': ['model_39_conv'], 'calculate': 'getattr(self.model, "39").act(model_39_conv)'}, {'name': 'model_40_conv', 'operator': 'conv', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "40").conv(model_37_act)'}, {'name': 'model_40_act', 'operator': 'act', 'users': 1, 'args': ['model_40_conv'], 'calculate': 'getattr(self.model, "40").act(model_40_conv)'}, {'name': 'model_41_conv', 'operator': 'conv', 'users': 1, 'args': ['model_40_act'], 'calculate': 'getattr(self.model, "41").conv(model_40_act)'}, {'name': 'model_41_act', 'operator': 'act', 'users': 1, 'args': ['model_41_conv'], 'calculate': 'getattr(self.model, "41").act(model_41_conv)'}, {'name': 'cat_5', 'operator': '5', 'users': 2, 'args': ['model_41_act', 'model_39_act'], 'calculate': 'torch.cat([model_41_act, model_39_act], 1)'}, {'name': 'model_43_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_5'], 'calculate': 'getattr(self.model, "43").conv(cat_5)'}, {'name': 'model_43_act', 'operator': 'act', 'users': 1, 'args': ['model_43_conv'], 'calculate': 'getattr(self.model, "43").act(model_43_conv)'}, {'name': 'model_44_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_5'], 'calculate': 'getattr(self.model, "44").conv(cat_5)'}, {'name': 'model_44_act', 'operator': 'act', 'users': 2, 'args': ['model_44_conv'], 'calculate': 'getattr(self.model, "44").act(model_44_conv)'}, {'name': 'model_45_conv', 'operator': 'conv', 'users': 1, 'args': ['model_44_act'], 'calculate': 'getattr(self.model, "45").conv(model_44_act)'}, {'name': 'model_45_act', 'operator': 'act', 'users': 1, 'args': ['model_45_conv'], 'calculate': 'getattr(self.model, "45").act(model_45_conv)'}, {'name': 'model_46_conv', 'operator': 'conv', 'users': 1, 'args': ['model_45_act'], 'calculate': 'getattr(self.model, "46").conv(model_45_act)'}, {'name': 'model_46_act', 'operator': 'act', 'users': 2, 'args': ['model_46_conv'], 'calculate': 'getattr(self.model, "46").act(model_46_conv)'}, {'name': 'model_47_conv', 'operator': 'conv', 'users': 1, 'args': ['model_46_act'], 'calculate': 'getattr(self.model, "47").conv(model_46_act)'}, {'name': 'model_47_act', 'operator': 'act', 'users': 1, 'args': ['model_47_conv'], 'calculate': 'getattr(self.model, "47").act(model_47_conv)'}, {'name': 'model_48_conv', 'operator': 'conv', 'users': 1, 'args': ['model_47_act'], 'calculate': 'getattr(self.model, "48").conv(model_47_act)'}, {'name': 'model_48_act', 'operator': 'act', 'users': 1, 'args': ['model_48_conv'], 'calculate': 'getattr(self.model, "48").act(model_48_conv)'}, {'name': 'cat_6', 'operator': '6', 'users': 1, 'args': ['model_48_act', 'model_46_act', 'model_44_act', 'model_43_act'], 'calculate': 'torch.cat([model_48_act, model_46_act, model_44_act, model_43_act], 1)'}, {'name': 'model_50_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_6'], 'calculate': 'getattr(self.model, "50").conv(cat_6)'}, {'name': 'model_50_act', 'operator': 'act', 'users': 2, 'args': ['model_50_conv'], 'calculate': 'getattr(self.model, "50").act(model_50_conv)'}, {'name': 'model_51_cv1_conv', 'operator': 'conv', 'users': 1, 'args': ['model_50_act'], 'calculate': 'getattr(self.model, "51").cv1.conv(model_50_act)'}, {'name': 'model_51_cv1_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv1_conv'], 'calculate': 'getattr(self.model, "51").cv1.act(model_51_cv1_conv)'}, {'name': 'model_51_cv3_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv1_act'], 'calculate': 'getattr(self.model, "51").cv3.conv(model_51_cv1_act)'}, {'name': 'model_51_cv3_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv3_conv'], 'calculate': 'getattr(self.model, "51").cv3.act(model_51_cv3_conv)'}, {'name': 'model_51_cv4_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv3_act'], 'calculate': 'getattr(self.model, "51").cv4.conv(model_51_cv3_act)'}, {'name': 'model_51_cv4_act', 'operator': 'act', 'users': 4, 'args': ['model_51_cv4_conv'], 'calculate': 'getattr(self.model, "51").cv4.act(model_51_cv4_conv)'}, {'name': 'model_51_m_0', 'operator': '0', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "0")(model_51_cv4_act)'}, {'name': 'model_51_m_1', 'operator': '1', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "1")(model_51_cv4_act)'}, {'name': 'model_51_m_2', 'operator': '2', 'users': 1, 'args': ['model_51_cv4_act'], 'calculate': 'getattr(getattr(self.model, "51").m, "2")(model_51_cv4_act)'}, {'name': 'cat_7', 'operator': '7', 'users': 1, 'args': ['model_51_cv4_act', 'model_51_m_0', 'model_51_m_1', 'model_51_m_2'], 'calculate': 'torch.cat([model_51_cv4_act, model_51_m_0, model_51_m_1, model_51_m_2], 1)'}, {'name': 'model_51_cv5_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_7'], 'calculate': 'getattr(self.model, "51").cv5.conv(cat_7)'}, {'name': 'model_51_cv5_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv5_conv'], 'calculate': 'getattr(self.model, "51").cv5.act(model_51_cv5_conv)'}, {'name': 'model_51_cv6_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv5_act'], 'calculate': 'getattr(self.model, "51").cv6.conv(model_51_cv5_act)'}, {'name': 'model_51_cv6_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv6_conv'], 'calculate': 'getattr(self.model, "51").cv6.act(model_51_cv6_conv)'}, {'name': 'model_51_cv2_conv', 'operator': 'conv', 'users': 1, 'args': ['model_50_act'], 'calculate': 'getattr(self.model, "51").cv2.conv(model_50_act)'}, {'name': 'model_51_cv2_act', 'operator': 'act', 'users': 1, 'args': ['model_51_cv2_conv'], 'calculate': 'getattr(self.model, "51").cv2.act(model_51_cv2_conv)'}, {'name': 'cat_8', 'operator': '8', 'users': 1, 'args': ['model_51_cv6_act', 'model_51_cv2_act'], 'calculate': 'torch.cat((model_51_cv6_act, model_51_cv2_act), dim'}, {'name': 'model_51_cv7_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_8'], 'calculate': 'getattr(self.model, "51").cv7.conv(cat_8)'}, {'name': 'model_51_cv7_act', 'operator': 'act', 'users': 2, 'args': ['model_51_cv7_conv'], 'calculate': 'getattr(self.model, "51").cv7.act(model_51_cv7_conv)'}, {'name': 'model_52_conv', 'operator': 'conv', 'users': 1, 'args': ['model_51_cv7_act'], 'calculate': 'getattr(self.model, "52").conv(model_51_cv7_act)'}, {'name': 'model_52_act', 'operator': 'act', 'users': 1, 'args': ['model_52_conv'], 'calculate': 'getattr(self.model, "52").act(model_52_conv)'}, {'name': 'model_53', 'operator': '53', 'users': 1, 'args': ['model_52_act'], 'calculate': 'getattr(self.model, "53")(model_52_act)'}, {'name': 'model_54_conv', 'operator': 'conv', 'users': 1, 'args': ['model_37_act'], 'calculate': 'getattr(self.model, "54").conv(model_37_act)'}, {'name': 'model_54_act', 'operator': 'act', 'users': 1, 'args': ['model_54_conv'], 'calculate': 'getattr(self.model, "54").act(model_54_conv)'}, {'name': 'cat_9', 'operator': '9', 'users': 2, 'args': ['model_54_act', 'model_53'], 'calculate': 'torch.cat([model_54_act, model_53], 1)'}, {'name': 'model_56_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_9'], 'calculate': 'getattr(self.model, "56").conv(cat_9)'}, {'name': 'model_56_act', 'operator': 'act', 'users': 1, 'args': ['model_56_conv'], 'calculate': 'getattr(self.model, "56").act(model_56_conv)'}, {'name': 'model_57_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_9'], 'calculate': 'getattr(self.model, "57").conv(cat_9)'}, {'name': 'model_57_act', 'operator': 'act', 'users': 2, 'args': ['model_57_conv'], 'calculate': 'getattr(self.model, "57").act(model_57_conv)'}, {'name': 'model_58_conv', 'operator': 'conv', 'users': 1, 'args': ['model_57_act'], 'calculate': 'getattr(self.model, "58").conv(model_57_act)'}, {'name': 'model_58_act', 'operator': 'act', 'users': 2, 'args': ['model_58_conv'], 'calculate': 'getattr(self.model, "58").act(model_58_conv)'}, {'name': 'model_59_conv', 'operator': 'conv', 'users': 1, 'args': ['model_58_act'], 'calculate': 'getattr(self.model, "59").conv(model_58_act)'}, {'name': 'model_59_act', 'operator': 'act', 'users': 2, 'args': ['model_59_conv'], 'calculate': 'getattr(self.model, "59").act(model_59_conv)'}, {'name': 'model_60_conv', 'operator': 'conv', 'users': 1, 'args': ['model_59_act'], 'calculate': 'getattr(self.model, "60").conv(model_59_act)'}, {'name': 'model_60_act', 'operator': 'act', 'users': 2, 'args': ['model_60_conv'], 'calculate': 'getattr(self.model, "60").act(model_60_conv)'}, {'name': 'model_61_conv', 'operator': 'conv', 'users': 1, 'args': ['model_60_act'], 'calculate': 'getattr(self.model, "61").conv(model_60_act)'}, {'name': 'model_61_act', 'operator': 'act', 'users': 1, 'args': ['model_61_conv'], 'calculate': 'getattr(self.model, "61").act(model_61_conv)'}, {'name': 'cat_10', 'operator': '10', 'users': 1, 'args': ['model_61_act', 'model_60_act', 'model_59_act', 'model_58_act', 'model_57_act', 'model_56_act'], 'calculate': 'torch.cat([model_61_act, model_60_act, model_59_act, model_58_act, model_57_act, model_56_act], 1)'}, {'name': 'model_63_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_10'], 'calculate': 'getattr(self.model, "63").conv(cat_10)'}, {'name': 'model_63_act', 'operator': 'act', 'users': 2, 'args': ['model_63_conv'], 'calculate': 'getattr(self.model, "63").act(model_63_conv)'}, {'name': 'model_64_conv', 'operator': 'conv', 'users': 1, 'args': ['model_63_act'], 'calculate': 'getattr(self.model, "64").conv(model_63_act)'}, {'name': 'model_64_act', 'operator': 'act', 'users': 1, 'args': ['model_64_conv'], 'calculate': 'getattr(self.model, "64").act(model_64_conv)'}, {'name': 'model_65', 'operator': '65', 'users': 1, 'args': ['model_64_act'], 'calculate': 'getattr(self.model, "65")(model_64_act)'}, {'name': 'model_66_conv', 'operator': 'conv', 'users': 1, 'args': ['model_24_act'], 'calculate': 'getattr(self.model, "66").conv(model_24_act)'}, {'name': 'model_66_act', 'operator': 'act', 'users': 1, 'args': ['model_66_conv'], 'calculate': 'getattr(self.model, "66").act(model_66_conv)'}, {'name': 'cat_11', 'operator': '11', 'users': 2, 'args': ['model_66_act', 'model_65'], 'calculate': 'torch.cat([model_66_act, model_65], 1)'}, {'name': 'model_68_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_11'], 'calculate': 'getattr(self.model, "68").conv(cat_11)'}, {'name': 'model_68_act', 'operator': 'act', 'users': 1, 'args': ['model_68_conv'], 'calculate': 'getattr(self.model, "68").act(model_68_conv)'}, {'name': 'model_69_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_11'], 'calculate': 'getattr(self.model, "69").conv(cat_11)'}, {'name': 'model_69_act', 'operator': 'act', 'users': 2, 'args': ['model_69_conv'], 'calculate': 'getattr(self.model, "69").act(model_69_conv)'}, {'name': 'model_70_conv', 'operator': 'conv', 'users': 1, 'args': ['model_69_act'], 'calculate': 'getattr(self.model, "70").conv(model_69_act)'}, {'name': 'model_70_act', 'operator': 'act', 'users': 2, 'args': ['model_70_conv'], 'calculate': 'getattr(self.model, "70").act(model_70_conv)'}, {'name': 'model_71_conv', 'operator': 'conv', 'users': 1, 'args': ['model_70_act'], 'calculate': 'getattr(self.model, "71").conv(model_70_act)'}, {'name': 'model_71_act', 'operator': 'act', 'users': 2, 'args': ['model_71_conv'], 'calculate': 'getattr(self.model, "71").act(model_71_conv)'}, {'name': 'model_72_conv', 'operator': 'conv', 'users': 1, 'args': ['model_71_act'], 'calculate': 'getattr(self.model, "72").conv(model_71_act)'}, {'name': 'model_72_act', 'operator': 'act', 'users': 2, 'args': ['model_72_conv'], 'calculate': 'getattr(self.model, "72").act(model_72_conv)'}, {'name': 'model_73_conv', 'operator': 'conv', 'users': 1, 'args': ['model_72_act'], 'calculate': 'getattr(self.model, "73").conv(model_72_act)'}, {'name': 'model_73_act', 'operator': 'act', 'users': 1, 'args': ['model_73_conv'], 'calculate': 'getattr(self.model, "73").act(model_73_conv)'}, {'name': 'cat_12', 'operator': '12', 'users': 1, 'args': ['model_73_act', 'model_72_act', 'model_71_act', 'model_70_act', 'model_69_act', 'model_68_act'], 'calculate': 'torch.cat([model_73_act, model_72_act, model_71_act, model_70_act, model_69_act, model_68_act], 1)'}, {'name': 'model_75_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_12'], 'calculate': 'getattr(self.model, "75").conv(cat_12)'}, {'name': 'model_75_act', 'operator': 'act', 'users': 3, 'args': ['model_75_conv'], 'calculate': 'getattr(self.model, "75").act(model_75_conv)'}, {'name': 'model_76_m', 'operator': 'm', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(self.model, "76").m(model_75_act)'}, {'name': 'model_77_conv', 'operator': 'conv', 'users': 1, 'args': ['model_76_m'], 'calculate': 'getattr(self.model, "77").conv(model_76_m)'}, {'name': 'model_77_act', 'operator': 'act', 'users': 1, 'args': ['model_77_conv'], 'calculate': 'getattr(self.model, "77").act(model_77_conv)'}, {'name': 'model_78_conv', 'operator': 'conv', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(self.model, "78").conv(model_75_act)'}, {'name': 'model_78_act', 'operator': 'act', 'users': 1, 'args': ['model_78_conv'], 'calculate': 'getattr(self.model, "78").act(model_78_conv)'}, {'name': 'model_79_conv', 'operator': 'conv', 'users': 1, 'args': ['model_78_act'], 'calculate': 'getattr(self.model, "79").conv(model_78_act)'}, {'name': 'model_79_act', 'operator': 'act', 'users': 1, 'args': ['model_79_conv'], 'calculate': 'getattr(self.model, "79").act(model_79_conv)'}, {'name': 'cat_13', 'operator': '13', 'users': 2, 'args': ['model_79_act', 'model_77_act', 'model_63_act'], 'calculate': 'torch.cat([model_79_act, model_77_act, model_63_act], 1)'}, {'name': 'model_81_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_13'], 'calculate': 'getattr(self.model, "81").conv(cat_13)'}, {'name': 'model_81_act', 'operator': 'act', 'users': 1, 'args': ['model_81_conv'], 'calculate': 'getattr(self.model, "81").act(model_81_conv)'}, {'name': 'model_82_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_13'], 'calculate': 'getattr(self.model, "82").conv(cat_13)'}, {'name': 'model_82_act', 'operator': 'act', 'users': 2, 'args': ['model_82_conv'], 'calculate': 'getattr(self.model, "82").act(model_82_conv)'}, {'name': 'model_83_conv', 'operator': 'conv', 'users': 1, 'args': ['model_82_act'], 'calculate': 'getattr(self.model, "83").conv(model_82_act)'}, {'name': 'model_83_act', 'operator': 'act', 'users': 2, 'args': ['model_83_conv'], 'calculate': 'getattr(self.model, "83").act(model_83_conv)'}, {'name': 'model_84_conv', 'operator': 'conv', 'users': 1, 'args': ['model_83_act'], 'calculate': 'getattr(self.model, "84").conv(model_83_act)'}, {'name': 'model_84_act', 'operator': 'act', 'users': 2, 'args': ['model_84_conv'], 'calculate': 'getattr(self.model, "84").act(model_84_conv)'}, {'name': 'model_85_conv', 'operator': 'conv', 'users': 1, 'args': ['model_84_act'], 'calculate': 'getattr(self.model, "85").conv(model_84_act)'}, {'name': 'model_85_act', 'operator': 'act', 'users': 2, 'args': ['model_85_conv'], 'calculate': 'getattr(self.model, "85").act(model_85_conv)'}, {'name': 'model_86_conv', 'operator': 'conv', 'users': 1, 'args': ['model_85_act'], 'calculate': 'getattr(self.model, "86").conv(model_85_act)'}, {'name': 'model_86_act', 'operator': 'act', 'users': 1, 'args': ['model_86_conv'], 'calculate': 'getattr(self.model, "86").act(model_86_conv)'}, {'name': 'cat_14', 'operator': '14', 'users': 1, 'args': ['model_86_act', 'model_85_act', 'model_84_act', 'model_83_act', 'model_82_act', 'model_81_act'], 'calculate': 'torch.cat([model_86_act, model_85_act, model_84_act, model_83_act, model_82_act, model_81_act], 1)'}, {'name': 'model_88_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_14'], 'calculate': 'getattr(self.model, "88").conv(cat_14)'}, {'name': 'model_88_act', 'operator': 'act', 'users': 3, 'args': ['model_88_conv'], 'calculate': 'getattr(self.model, "88").act(model_88_conv)'}, {'name': 'model_89_m', 'operator': 'm', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(self.model, "89").m(model_88_act)'}, {'name': 'model_90_conv', 'operator': 'conv', 'users': 1, 'args': ['model_89_m'], 'calculate': 'getattr(self.model, "90").conv(model_89_m)'}, {'name': 'model_90_act', 'operator': 'act', 'users': 1, 'args': ['model_90_conv'], 'calculate': 'getattr(self.model, "90").act(model_90_conv)'}, {'name': 'model_91_conv', 'operator': 'conv', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(self.model, "91").conv(model_88_act)'}, {'name': 'model_91_act', 'operator': 'act', 'users': 1, 'args': ['model_91_conv'], 'calculate': 'getattr(self.model, "91").act(model_91_conv)'}, {'name': 'model_92_conv', 'operator': 'conv', 'users': 1, 'args': ['model_91_act'], 'calculate': 'getattr(self.model, "92").conv(model_91_act)'}, {'name': 'model_92_act', 'operator': 'act', 'users': 1, 'args': ['model_92_conv'], 'calculate': 'getattr(self.model, "92").act(model_92_conv)'}, {'name': 'cat_15', 'operator': '15', 'users': 2, 'args': ['model_92_act', 'model_90_act', 'model_51_cv7_act'], 'calculate': 'torch.cat([model_92_act, model_90_act, model_51_cv7_act], 1)'}, {'name': 'model_94_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_15'], 'calculate': 'getattr(self.model, "94").conv(cat_15)'}, {'name': 'model_94_act', 'operator': 'act', 'users': 1, 'args': ['model_94_conv'], 'calculate': 'getattr(self.model, "94").act(model_94_conv)'}, {'name': 'model_95_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_15'], 'calculate': 'getattr(self.model, "95").conv(cat_15)'}, {'name': 'model_95_act', 'operator': 'act', 'users': 2, 'args': ['model_95_conv'], 'calculate': 'getattr(self.model, "95").act(model_95_conv)'}, {'name': 'model_96_conv', 'operator': 'conv', 'users': 1, 'args': ['model_95_act'], 'calculate': 'getattr(self.model, "96").conv(model_95_act)'}, {'name': 'model_96_act', 'operator': 'act', 'users': 2, 'args': ['model_96_conv'], 'calculate': 'getattr(self.model, "96").act(model_96_conv)'}, {'name': 'model_97_conv', 'operator': 'conv', 'users': 1, 'args': ['model_96_act'], 'calculate': 'getattr(self.model, "97").conv(model_96_act)'}, {'name': 'model_97_act', 'operator': 'act', 'users': 2, 'args': ['model_97_conv'], 'calculate': 'getattr(self.model, "97").act(model_97_conv)'}, {'name': 'model_98_conv', 'operator': 'conv', 'users': 1, 'args': ['model_97_act'], 'calculate': 'getattr(self.model, "98").conv(model_97_act)'}, {'name': 'model_98_act', 'operator': 'act', 'users': 2, 'args': ['model_98_conv'], 'calculate': 'getattr(self.model, "98").act(model_98_conv)'}, {'name': 'model_99_conv', 'operator': 'conv', 'users': 1, 'args': ['model_98_act'], 'calculate': 'getattr(self.model, "99").conv(model_98_act)'}, {'name': 'model_99_act', 'operator': 'act', 'users': 1, 'args': ['model_99_conv'], 'calculate': 'getattr(self.model, "99").act(model_99_conv)'}, {'name': 'cat_16', 'operator': '16', 'users': 1, 'args': ['model_99_act', 'model_98_act', 'model_97_act', 'model_96_act', 'model_95_act', 'model_94_act'], 'calculate': 'torch.cat([model_99_act, model_98_act, model_97_act, model_96_act, model_95_act, model_94_act], 1)'}, {'name': 'model_101_conv', 'operator': 'conv', 'users': 1, 'args': ['cat_16'], 'calculate': 'getattr(self.model, "101").conv(cat_16)'}, {'name': 'model_101_act', 'operator': 'act', 'users': 1, 'args': ['model_101_conv'], 'calculate': 'getattr(self.model, "101").act(model_101_conv)'}, {'name': 'model_102_rbr_reparam', 'operator': 'reparam', 'users': 1, 'args': ['model_75_act'], 'calculate': 'getattr(self.model, "102").rbr_reparam(model_75_act)'}, {'name': 'model_102_act', 'operator': 'act', 'users': 1, 'args': ['model_102_rbr_reparam'], 'calculate': 'getattr(self.model, "102").act(model_102_rbr_reparam)'}, {'name': 'model_103_rbr_reparam', 'operator': 'reparam', 'users': 1, 'args': ['model_88_act'], 'calculate': 'getattr(self.model, "103").rbr_reparam(model_88_act)'}, {'name': 'model_103_act', 'operator': 'act', 'users': 1, 'args': ['model_103_rbr_reparam'], 'calculate': 'getattr(self.model, "103").act(model_103_rbr_reparam)'}, {'name': 'model_104_rbr_reparam', 'operator': 'reparam', 'users': 1, 'args': ['model_101_act'], 'calculate': 'getattr(self.model, "104").rbr_reparam(model_101_act)'}, {'name': 'model_104_act', 'operator': 'act', 'users': 1, 'args': ['model_104_rbr_reparam'], 'calculate': 'getattr(self.model, "104").act(model_104_rbr_reparam)'}]
self.G = self.drawnodes()
def getnodes(self):
code = str(self.gm.code).split("\n")
code = [i.strip() for i in code[2:-2]]
code_dic = {}
code = [i.split(";")[0] for i in code]
for i in code:
code_dic[i.split("=")[0].strip()] = i.split("=")[1].strip()
# 节点结果存为列表形式
# print(code_dic)
df = str(self.gm.graph).split("\n")[2:-1]
while int(df[0][df[0].find("users=") + 6: df[0].find("] =")]) == 0:
df.pop(0)
# print(df)
nodes = []
pattern = r" %(.+?) : \[#"
pattern1 = r"args = \((.+?)\), kwa"
# 解析图
for s in df:
num_user = int(s[s.find("users=") + 6: s.find("] =")])
if num_user == 0:
continue
dic = dict()
name = re.findall(pattern=pattern, string=s)[0]
dic['name'] = name
dic['operator'] = name.split("_")[-1]
dic['users'] = num_user
args = re.findall(pattern=pattern1, string=s)[0]
if args.startswith("["):
args = args[args.find("[") + 1: args.rfind("]")]
elif args.startswith("("):
args = args[args.find("(") + 1: args.rfind(")")]
elif args.endswith(","):
args = args[:-1]
args = args.split(",")
args = [i.replace("%", "").strip() for i in args]
# 计算图的头节点args置空
# if args[0] == "x" or args[0] =="input_1":
# args = []
args = [a for a in args if a != ""]
dic['args'] = args
dic['calculate'] = code_dic[name]
nodes.append(dic)
names = [i['name'] for i in nodes]
for i in range(len(nodes)):
if len(nodes[i]['args']) == 1 and nodes[i]['args'][0] not in names:
nodes[i]['args'] = []
break
# print(nodes)
return nodes
def drawnodes(self):
G = nx.DiGraph()
for k in self.nodes:
G.add_node(k['name'])
G.nodes[k['name']]['operator'] = k['operator']
G.nodes[k['name']]['calculate'] = k['calculate']
G.nodes[k['name']]['args'] = k['args']
if k['args'] == None:
continue
elif len(k['args']) == 1:
G.add_edge(str(k['name']), str(k['args'][0]))
elif len(k['args']) > 1:
for i in k['args']:
i = str(i).replace("('", "").replace(")", "")
if i in G:
G.add_edge(str(k['name']), str(i))
else:
G.add_edge(str(k['name']), str(k['name']))
G.nodes[k['name']]['args'] = k['name']
fig, ax = plt.subplots(figsize=(30, 30))
pos = nx.spiral_layout(G, resolution=0.7)
nx.draw(G, pos, with_labels=True, node_size=100, alpha=1, linewidths=70, ax=ax, horizontalalignment='left')
plt.savefig("2.jpg", dpi=1000)
return G
import re
class ModelInference:
def __init__(self, G, model, a):
self.a = a
self.count = 0
self.net = model
for key, value in enumerate(G.nodes):
calculate = G.nodes[value]['calculate']
args = G.nodes[value]['args']
operator = G.nodes[value]['operator']
# users = self.G.nodes[value]['users']
if 'torch' in calculate:
self.catinfer(args, calculate, value, G.degree[value])
else:
self.infer(args, calculate, value, self.count, operator)
self.count += 1
result = torch.load(self.a.get(list(self.a.keys())[-1]))
print("model done")
def infer(self, args, cal, value, count, operator):
if count == 0: # first one
x = self.a.get('x')#改成列表第一个的key #inceptionv4 yolov7
res = cal.replace('(x)', "")
temp = re.findall(r'getattr\(self.(.+?), "(.+?)"\)\.(.+?)\b', res)
res = temp[0][0] + f"[{temp[0][1]}]" + "." + temp[0][2]
res = 'self.net.' + res
r = eval(res)(x)
r = r.detach()
# func = cal.split('self.', 1)[1] #googlenet
# t = self.a.get('x')
# res = func.replace('x', t)
# res = 'self.net.' + res
# r = eval(res)
# r = r.detach()
#YOLOv5
# x = self.a.get('x')
# r = eval(cal, {"x":x})
elif args == None:
# print(cal) #getattr(getattr(self.model, "105").ia, "0").implicit
res = "self.net."
pattern = r'getattr\(getattr\(self.(.+?), "(.+?)"\)\.(.+?), "(.+?)"\)\.(.+?)\b'
temp = re.findall(pattern, cal)
res += temp[0][0] + f"[{temp[0][1]}]" + "." + temp[0][2] + f"[{temp[0][3]}]" + "." + temp[0][4]
r = eval(res)
elif 'mul' in value:
t1 = torch.load(self.a.get(args[0]))
t2 = torch.load(self.a.get(args[1]))
r = t1 * t2
elif 'add' in value:
r = torch.load(self.a.get(args[0]))
for i in args[1:]:
if i.isdigit():
continue
else:
x = self.a.get(i)
y = torch.load(x)
# torch.add(r, y, out=r)
r = torch.add(r, y)
elif 'view' in value:
para = []
for i in args:
if not i.isdigit():
para.append(i)
r = eval(cal, {para[0]: torch.load(self.a.get(para[0])), para[1]: torch.load(self.a.get(para[1])),
para[2]: torch.load(self.a.get(para[2])), para[3]: torch.load(self.a.get(para[3]))})
elif 'permute' in value:
for i in args:
if not i.isdigit():
x = self.a.get(i)
t = torch.load(x)
cal = cal.replace(i, 't')
r = eval(cal, {'t': t})
elif not ('getattr' in cal):
if 'self' in cal:
for i in args:
x = self.a.get(i)
t = torch.load(x)
cal = cal.replace(i, "")
func = cal.split('self.', 1)[1]
res = func.split('(', 1)[0]
res = 'self.net.' + res
r = eval(res).eval()(t)
r = r.detach()
elif any(x in cal for x in ["shape", "size", "contiguous"]):
for i in args:
if not (i == 'shape'):
x = self.a.get(i)
x = torch.load(x)
if isinstance(x, int):
cal = cal.replace(i, str(x))
else:
t = x
cal = cal.replace(i, 't')
r = eval(cal, {'t': t})
elif 'getitem' in value:
for i in args:
if not i.isdigit():
x = self.a.get(i)
t = torch.load(x)
func = cal.replace(i, '')
r = t[int(func[1])]
else:
res, t = self.branchinfer(cal, value, args, operator)
r = eval(res).eval()(t)
r = r.detach()
ad = "{}.pt".format(value)
torch.save(r, ad)
self.a.update({value: ad})
def branchinfer(self, func, value, name, operator):
for i in name:
x = self.a.get(i)
t = torch.load(x)
res = self.handling(func)
return res, t
def handling(self, s):
res = "self.net."
try:
pattern = r'getattr\(self.(.+?), "(.+?)"\)\.(.+?)\('
temp = re.findall(pattern, s)
res += temp[0][0]
res += f"[{temp[0][1]}]"
branch = temp[0][2]
if "." not in branch and "," not in branch:
res += "." + branch
return res
temp = branch.split(".")
if "," in temp[0]:
res += f".{temp[0].split(',')[0]}"
p1 = r'"(.+?)"'
o = re.findall(p1, f"{temp[0].split(',')[1]}")[0]
res += f"[{o}]"
else:
res += "." + temp[0]
if len(temp) > 1:
res += "." + temp[1]
return res
except:
temp = re.findall(r'getattr\(self.(.+?), "(.+?)"', s)
res += temp[0][0] + f"[{temp[0][1]}]"
return res
def catinfer(self, name, cal, value, degree):
if 'torch.cat' in cal:
if len(name) == 1:
x = self.a.get(str(name[0]))
t = torch.load(x)
res = cal.replace(name[0], '')
res = res.split('(', 1)[0]
r = eval(res)(t, 1)
else:
# name = str(name).replace("'", "").replace(" ", "")[2:-2].split(",")
# print(name)
branch = self.a.get(str(name[0]))
r = torch.load(branch)
for i in range(1, len(name)):
x = self.a.get(str(name[i]).strip("()"))
t = torch.load(x)
# print(r.shape, x, t.shape)
r = torch.cat([r, t], 1)
else:
x = self.a.get(str(name[0]))
t = torch.load(x)
res = cal.replace(name[0], '')
res, num = res.split('(', 1)
num = re.sub(u"([^\u0030-\u0039\u002e\uffe5])", "", num)
r = eval(res)(t, int(num))
ad = "{}.pt".format(value)
torch.save(r, ad)
self.a.update({value: ad})
import argparse
from utils.datasets import LoadImages, LoadStreams
from utils.general import check_img_size, check_requirements, check_imshow, non_max_suppression, apply_classifier, \
scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path,check_file
from utils.torch_utils import time_synchronized, fuse_conv_and_bn, model_info, scale_img, initialize_weights, \
select_device, copy_attr
from models.yolo import *
from models.experimental import attempt_load
from utils.torch_utils import select_device, load_classifier, time_synchronized, TracedModel
import cv2
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# parser.add_argument('--cfg', type=str, default='.\\cfg\\training\\yolov7.yaml', help='model.yaml')
parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
# parser.add_argument('--profile', action='store_true', help='profile model speed')
parser.add_argument('--weights', nargs='+', type=str, default='yolov7.pt', help='model.pt path(s)')
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
parser.add_argument('--view-img', action='store_true', help='display results')
parser.add_argument('--nosave', action='store_true', help='do not save images/videos')
parser.add_argument('--project', default='runs/test', help='save results to project/name')
opt = parser.parse_args()
# opt.cfg = check_file(opt.cfg) # check file
# set_logging()
device = select_device(opt.device)
#
# # Create model
# model = Model(opt.cfg).to(device)
# model.train() #from yolo.py model
#step 1
G = Draw_G.drawnodes(Draw_G())
stride = 32
imgsz = check_img_size(640, s=stride)
pt = True
source = 'normalvideo.mp4'
save_img = not opt.nosave and not source.endswith('.txt')
view_img = opt.view_img
names = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
'elephant',
'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis',
'snowboard',
'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
'bottle',
'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli',
'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table',
'toilet',
'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush']
colors = [[random.randint(0, 255) for _ in range(3)] for _ in names]
vid_path, vid_writer = None, None
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
('rtsp://', 'rtmp://', 'http://', 'https://'))
if webcam:
view_img = check_imshow()
# cudnn.benchmark = True # set True to speed up constant image size inference
dataset = LoadStreams(source, img_size=imgsz, stride=stride)
else:
dataset = LoadImages(source, img_size=imgsz, stride=stride)
im0 = []
for path, im, im0s, vid_cap in dataset:
im = torch.from_numpy(im).to(device)
im = im.float()
im /= 255 # 0 - 255 to 0.0 - 1.0
if len(im.shape) == 3:
im = im[None]
# a = ({"x": "torch.randn([1, 3, 640, 640]).to(torch.device('cuda'))"})
a = ({"x": im})
model = attempt_load(opt.weights, map_location=device)
#step 2
ModelInference(G, model, a)
t1 = torch.load("model_102_act.pt")
t2 = torch.load("model_103_act.pt")
t3 = torch.load("model_104_act.pt")
out = [t1, t2, t3]
detect_layer = model.model[-1]
out = detect_layer(out)
# print(out[0].shape)
pred = non_max_suppression(out[0], opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=opt.agnostic_nms)
# Apply Classifier
# if classify:
# pred = apply_classifier(pred, modelc, img, im0s)
# Process detections
for i, det in enumerate(pred): # detections per image
if webcam: # batch_size >= 1
p, s, im0, frame = path[i], '%g: ' % i, im0s[i].copy(), dataset.count
else:
p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0)
save_dir = Path(opt.project)
p = Path(p)
save_path = str(save_dir / p.name)
gn = torch.tensor(im0.shape)[[1, 0, 1, 0]] # normalization gain whwh
if len(det):
# Rescale boxes from img_size to im0 size
det[:, :4] = scale_coords(im.shape[2:], det[:, :4], im0.shape).round()
# Print results
for c in det[:, -1].unique():
n = (det[:, -1] == c).sum() # detections per class
s = f"{n} {names[int(c)]}{'s' * (n > 1)}, " # add to string
# Write results
for *xyxy, conf, cls in reversed(det):
label = f'{names[int(cls)]} {conf:.2f}'
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=1)
if save_img:
if dataset.mode == 'image':
cv2.imwrite(save_path, im0)
print(f" The image with the result is saved in: {save_path}")
else:
if vid_path != save_path: # new video
vid_path = save_path
if isinstance(vid_writer, cv2.VideoWriter):
vid_writer.release() # release previous video writer
if vid_cap: # video
fps = vid_cap.get(cv2.CAP_PROP_FPS)
w = int(vid_cap.get(cv2.CAP_PROP_FRAME_WIDTH))
h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
else: # stream
fps, w, h = 30, im0.shape[1], im0.shape[0]
save_path += '.mp4'
vid_writer = cv2.VideoWriter(save_path, cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h))
vid_writer.write(im0)