mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 10:26:33 +00:00
Some fixes for yolo-v3. (#529)
* Some fixes for yolo-v3. * Use the running stats for inference in the batch-norm layer. * Get some proper predictions for yolo. * Avoid the quadratic insertion.
This commit is contained in:
7
candle-examples/examples/yolo-v3/extract-weights.py
Normal file
7
candle-examples/examples/yolo-v3/extract-weights.py
Normal file
@ -0,0 +1,7 @@
|
||||
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)
|
Reference in New Issue
Block a user