mirror of
https://github.com/hanzoai/ml.git
synced 2026-11-20 23:08:29 +00:00
8 lines
237 B
Python
8 lines
237 B
Python
def remove_prefix(text, prefix):
|
|
return text[text.startswith(prefix) and len(prefix):]
|
|
nps = {}
|
|
for k, v in model.state_dict().items():
|
|
k = remove_prefix(k, 'module_list.')
|
|
nps[k] = v.detach().numpy()
|
|
np.savez('yolo-v3.ot', **nps)
|