Transfer Model from Keras to PyTorch

Viewed 22

I have a trained resnet50 in Keras saved as ".pth" and want to transfer it to PyTorch. I used these lines, but it doesn't work. is there any other solution or missing something?

model_keras = load_model("model_path.pth")
weights = [torch.Tensor(w) for w in model_keras.get_weights()]
model = models.resnet50(weights=weights)              
0 Answers
Related