This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import shutil | |
import json | |
import sys | |
def fix_weight_file(model_path): | |
with h5py.File(model_path, "r+") as out_h5: | |
v = out_h5.attrs.get("model_config") | |
config = json.loads(v) |