Looking at Yunjey’s example here, the net is saved as a .pkl file. More so, the net is translated using a state_dict()
method before being saved as a pkl file.
I had a net trained with a good accuracy score on testing images. But I had it saved as resnet.pkl
file. I want to use the pretrained net to predict classification scores on real-time images. I found that using torch.load
would not suffice. What is the right way to convert this net to a .pth
file please? Pardon my question as I am relatively new to pytorch in general.
Also, is there a way to import a pytorch model into c++?