Export pretrained alexnet

This commit is contained in:
2024-04-20 15:49:59 +02:00
parent ab10959f35
commit 0807a0f2b8
5 changed files with 63 additions and 31 deletions

View File

@@ -0,0 +1,13 @@
import torchvision
import sys
sys.path.append('../../tools') # Ugly hack
from utils import export_model_weights, print_model_parameters
if __name__ == "__main__":
alexnet = torchvision.models.alexnet(pretrained=True)
print_model_parameters(alexnet) # print layer names and number of parameters
export_model_weights(alexnet, 'alexnet_weights.bin')
print()
print(alexnet)