Hi Andrea,
Could you help me understand the following error when loading the pre-trained quantum weights? I have been trying to adapt the Quantum transfer learning code from your paper to my problem statement.
As explained by you, I trained my model_hybrid in pennylane simulator and saved the trained model as a .pt file. When I try to load the saved sate_dict in order to execute the model on the actual quantum hardware it gives me a "keys mismatch" error as follows:
P.S.: I am following your exact code for my work-- the
ants vs. bees example executed perfectly on the IBMQ machine as stated in my previous reply to Quantum transfer learning code (Mari et al., 2019) - IBMQDevice endless execution. I have no issues with loading the quantum_weights.pt file there. That code executed perfectly well. My problem is with another image classification problem at hand. How did you save the pre-trained model? I used the following function to do so:torch.save(model.state_dict(), PATH)
Are there any specific parameters that you specified while saving the trained model?
