I dont have a *.pkl model, but just have a *.pth model(pytorch).
Closed this issue · 1 comments
bemoregt commented
Hi, @elliebirbeck
I dont have a *.pkl model, but just have a *.pth model(pytorch).
Is my *.pth model also works in your code?
Thanks in advance~.
elliebirbeck commented
yep that will also work. the pkl library is just used to serialise the model, but any method of saving/loading the model can be used. you will need to replace the functions specific to joblib / pickle / scikitlearn with the pytorch equivalents.
e.g.
joblib.load('model.pkl') > torch.load('model.pth')
model.predict(img) > model.forward(img)
etc