Error using quantum nodes into Keras Layers using modulation dataset

Hi! I’, using tutorial example of turning quantum nodes into keras layers for modulation dataset but i got an error while running the code on jupyter notebook. same code is used as used in pennylane demo Turning quantum nodes into Keras Layers . error is not occuring when i use the classical keras layers excluding the qnlayer. also i ran the demo as it is and it gives the same error. i attached the error below
Epoch 1/6
WARNING:tensorflow:You are casting an input of type complex128 to an incompatible dtype float64. This will discard the imaginary part and may not be what you intended.
WARNING:tensorflow:You are casting an input of type complex128 to an incompatible dtype float64. This will discard the imaginary part and may not be what you intended.
WARNING:tensorflow:You are casting an input of type complex128 to an incompatible dtype float64. This will discard the imaginary part and may not be what you intended.
suggest a solution to this. thanks

Hey @Mahamiftikhar! Welcome to the forum :rocket:

I think this other forum post might be useful to check out:

Let me know if this helps!

Thanks for the suggestion @isaacdevlugt i already tried this but using this i got very low validation accuracy and high loss.

Hello @Mahamiftikhar ! :smile: This could also be due to many factors: the model is not expressive enough, the dataset is not good enough to generalize, …
In the end this is the challenge of the researcher, not easy at all!
Or do you think this is related to problem with PennyLane?

1 Like

@Guillermo_Alonso Yeah it’s possible that this is due to these factors.