mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 17:54:27 +00:00
Update inception v3 readme
This commit is contained in:
@@ -4,14 +4,21 @@ import sys
|
||||
sys.path.append("../../tools") # Ugly hack
|
||||
from utils import export_model_weights, print_model_parameters, predict
|
||||
|
||||
import torch
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
weights = torchvision.models.Inception_V3_Weights.DEFAULT
|
||||
inception = torchvision.models.inception_v3(
|
||||
weights=torchvision.models.Inception_V3_Weights.DEFAULT
|
||||
weights=weights,
|
||||
transform_input=False
|
||||
)
|
||||
|
||||
inception.transform_input = False
|
||||
inception.eval()
|
||||
|
||||
# print_model_parameters(inception) # print layer names and number of parameters
|
||||
export_model_weights(inception, "inception_v3_weights.bin")
|
||||
|
||||
# print(predict(inception, "bird.jpg"))
|
||||
# class_labels = weights.meta["categories"]
|
||||
# prediction = predict(inception, "bird.jpg")
|
||||
# print(prediction, class_labels[prediction])
|
||||
|
||||
Reference in New Issue
Block a user