Upload export_models.py
Browse files- export_models.py +12 -0
export_models.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This script exports pre-trained model weights in the safetensors format.
|
2 |
+
import numpy as np
|
3 |
+
import torch
|
4 |
+
import torchvision
|
5 |
+
from safetensors import torch as stt
|
6 |
+
|
7 |
+
m = torchvision.models.efficientnet_b5(pretrained=True)
|
8 |
+
stt.save_file(m.state_dict(), 'efficientnet-b5.safetensors')
|
9 |
+
m = torchvision.models.efficientnet_b6(pretrained=True)
|
10 |
+
stt.save_file(m.state_dict(), 'efficientnet-b6.safetensors')
|
11 |
+
m = torchvision.models.efficientnet_b7(pretrained=True)
|
12 |
+
stt.save_file(m.state_dict(), 'efficientnet-b7.safetensors')
|