FredZhang7
commited on
Commit
·
cac2154
1
Parent(s):
ac7c612
how did i miss example_inputs
Browse files
README.md
CHANGED
@@ -48,6 +48,10 @@ url = f"https://huggingface.co/FredZhang7/efficientnetv2.5_rw_s/resolve/main/{mo
|
|
48 |
file_name = f"./{base_model}.pth"
|
49 |
urllib.request.urlretrieve(url, file_name)
|
50 |
|
|
|
|
|
|
|
|
|
51 |
model = torch.load(file_name)
|
52 |
model.classifier = torch.nn.Linear(in_features=1984, out_features=nclass, bias=True)
|
53 |
macs, nparams = get_model_complexity_info(model, input_size, as_strings=False, print_per_layer_stat=print_layer_stats, verbose=verbose)
|
|
|
48 |
file_name = f"./{base_model}.pth"
|
49 |
urllib.request.urlretrieve(url, file_name)
|
50 |
|
51 |
+
shape = (2,) + input_size
|
52 |
+
example_inputs = torch.randn(shape)
|
53 |
+
example_inputs = (example_inputs - example_inputs.min()) / (example_inputs.max() - example_inputs.min())
|
54 |
+
|
55 |
model = torch.load(file_name)
|
56 |
model.classifier = torch.nn.Linear(in_features=1984, out_features=nclass, bias=True)
|
57 |
macs, nparams = get_model_complexity_info(model, input_size, as_strings=False, print_per_layer_stat=print_layer_stats, verbose=verbose)
|