File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
import pickle as pkl
4
4
import random
5
- from glob import glob
6
5
from io import BytesIO
7
6
from pathlib import Path
8
7
from typing import Callable
@@ -207,7 +206,7 @@ def absorb_batchNorm(model_target, model_original):
207
206
continue
208
207
weights = layer .get_weights ()
209
208
new_weights = model_original .get_layer (layer .name ).get_weights ()
210
- l = len (new_weights )
209
+ l = len (new_weights ) # noqa: E741 # If l looks like 1 by any chance, change your font.
211
210
layer .set_weights ([* new_weights , * weights [l :]][: len (weights )])
212
211
213
212
@@ -220,11 +219,6 @@ def set_seed(seed):
220
219
tf .config .experimental .enable_op_determinism ()
221
220
222
221
223
- import json
224
-
225
- import h5py as h5
226
-
227
-
228
222
def get_best_ckpt (save_path : Path , take_min = False ):
229
223
ckpts = list (save_path .glob ('*.h5' ))
230
224
You can’t perform that action at this time.
0 commit comments