# regex for renaming the tensors to their corresponding Keras counterpart
re_repeat = re.compile(r'Repeat_[0-9_]*b')
re_block8 = re.compile(r'Block8_[A-Za-z]')
for key in reader.get_variable_to_shape_map():
# not saving the following tensors
if key == 'global_step':
continue
if 'AuxLogit' in key:
continue
# convert tensor name into the corresponding Keras layer weight name and save
path = os.path.join(output_folder, get_filename(key))
arr = reader.get_tensor(key)
np.save(path, arr)