Closed HeyPhiS closed 8 months ago
Hi @HeyPhiS, thanks for reporting this! I did some digging on this today, and I believe I've root-caused the issue and proposed a fix. Once it gets merged in, we'll let you know here.
the fix has been merged to a feature branch, and will be released in PennyLane v0.34, coming next week! Keep an eye out for that release, and definitely let me know if anything else comes up
Great! Thank you very much very so quickly looking into this 🥇
Expected behavior
When using the tensorflow function
model.save
undtf.keras.models.load_model
it is expected that the model load all layers and its ways and recreates the saved model to include all weights etc.Actual behavior
When using
model.save
andtf.keras.models.load_model
with a hybrid model including both classical layers andqml.qnn.KerasLayerl
the network including the quantum layer is reloaded without error, however the weights of the quantum layer are not. This issue exists independent of the order of quantum and classical layers.Additional information
This issue was discussed in the pennylane support threat https://discuss.pennylane.ai/t/error-reloading-circuit-from-qasm-string/3679 This threat already gave rise to issue https://github.com/PennyLaneAI/pennylane/issues/4856 to which this issue is possibly related
Source code
Tracebacks
System information
Existing GitHub issues