hi, thank you for your reply.
I used this repo https://github.com/qfgaohao/pytorch-ssd 27
and I added my own code to save the net in one of the main python files (eg, run_ssd_example.py)
Some code are :
29 if net_type == ‘vgg16-ssd’:
30 net = create_vgg_ssd(len(class_names), is_test=True)
31 elif net_type == ‘mb1-ssd’:
32 net = create_mobilenetv1_ssd(len(class_names), is_test=True)
33 elif net_type == ‘mb1-ssd-lite’:
34 net = create_mobilenetv1_ssd_lite(len(class_names), is_test=True)
35 elif net_type == ‘mb2-ssd-lite’:
36 net = create_mobilenetv2_ssd_lite(len(class_names), is_test=True)
37 elif net_type == ‘sq-ssd-lite’:
38 net = create_squeezenet_ssd_lite(len(class_names), is_test=True)
39 else:
40 print(“The net type is wrong. It should be one of vgg16-ssd, mb1-ssd and mb1-ssd-lite.”)
41 sys.exit(1)
42
43
44 print(net)
_ 45 net.load(model_path)_
_ 46 _
_ 47 torch.save(net.state_dict(),‘mb_v1_ssd.pth’)_
_ 48 _
_ 49 _
_ 50 #net.load(model_path,map_location=‘cpu’)_
_ 51 _
_ 52 torch.save(net,‘mb_v1_ssd_all.pth’)_
53
54 if net_type == ‘vgg16-ssd’:
55 predictor = create_vgg_ssd_predictor(net, candidate_size=200)
56 elif net_type == ‘mb1-ssd’:
57 predictor = create_mobilenetv1_ssd_predictor(net, candidate_size=200)
58 elif net_type == ‘mb1-ssd-lite’:
59 predictor = create_mobilenetv1_ssd_lite_predictor(net, candidate_size=200)
60 elif net_type == ‘mb2-ssd-lite’:
61 predictor = create_mobilenetv2_ssd_lite_predictor(net, candidate_size=200)
62 elif net_type == ‘sq-ssd-lite’:
63 predictor = create_squeezenet_ssd_lite_predictor(net, candidate_size=200)
64 else:
65 print(“The net type is wrong. It should be one of vgg16-ssd, mb1-ssd and mb1-ssd-lite.”)
66 sys.exit(1)
line 44-52 is added by myself