File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import os
33import pickle as pkl
44import random
5- from glob import glob
65from io import BytesIO
76from pathlib import Path
87from typing import Callable
@@ -207,7 +206,7 @@ def absorb_batchNorm(model_target, model_original):
207206 continue
208207 weights = layer .get_weights ()
209208 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.
211210 layer .set_weights ([* new_weights , * weights [l :]][: len (weights )])
212211
213212
@@ -220,11 +219,6 @@ def set_seed(seed):
220219 tf .config .experimental .enable_op_determinism ()
221220
222221
223- import json
224-
225- import h5py as h5
226-
227-
228222def get_best_ckpt (save_path : Path , take_min = False ):
229223 ckpts = list (save_path .glob ('*.h5' ))
230224
You can’t perform that action at this time.
0 commit comments