-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'list' object has no attribute 'float' #17
Comments
Hey @sleepingcat4, could you tell us what version of PennyLane you're running (you can just print |
I am using PennyLane version: 0.31.1 |
Yep that explains it! With v0.30, we introduced new return types from QNodes — I think the error you're getting is most likely due to that particular change in PennyLane, but no guarantees because 0.7.0 is quite old. We have a nice documentation page that shows how the new return types impact legacy code: https://docs.pennylane.ai/en/stable/introduction/returns.html Let me know if that helps! |
thanks for reference, it worked and my issue is resolved! |
I though I had fixed it but unfortunately I am geetting the error: AttributeError: 'list' object has no attribute 'float' again. It turns out while I was running it on colab, though I had restarted my runtime, it used version 0.7.0 to execute the training process. I had earlier installed version v0.7.0 to test but installed the latest immediately afterwards as v0.7.0 didn't have device plug-in pre-packed. Can you please help me in resolving this error? |
Hey @sleepingcat4, I'm having some issues getting this notebook to run on my machine due to how old it is 😅. I'll need to investigate this further. Sit tight and I or one of my colleagues will respond this week. |
Hi @sleepingcat4 😄 The problem here is in In this case the Qnode is returning a list instead of a Tensor. To solve this, I would put:
within the From my point of view this is not expected behavior so I will let the team know so that they can keep it in mind and change it if they think it is appropriate 😊 |
I was running the
c2q_transfer_learning_ants_bees.ipynb
notebook and received an error in the qnet function about an attribute error. I am assuming it is happenning as float point is being applied on a list rather than tensors.Code that is causing the error:
Error Message:
Can someone help me fixing this error?
The text was updated successfully, but these errors were encountered: