-
Notifications
You must be signed in to change notification settings - Fork 121
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
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
#55
Comments
By the way, is it allowed to have objects protruding into the PML region or is this something that should be avoided? |
I am sorry @kerstin921 , I ran your code snippet with different versions of pytorch and for all the different backends but I can't seem to reproduce this error. To give you some context. It seems in your case that one of the following four tensors is placed on the cpu while the rest is on the gpu (or vice versa):
Maybe you set one of those values manually? Can you do a Thanks |
Thanks, this is my
|
The only permittivity value I modified is inside a
|
Very cool project! I look forward to seeing where it goes. I have the same error, when I use 'fdtd.AbsorbingObject'. Maybe there is something wrong with this function? |
In fact, it is a bit of bug. In the root file FDTD -> objects.py, line. 170, as the object of fdtd.AbsorbingObject initialized, the auther defined 'self.conductivity = conductivity', which is a type of numpy, or cpu. It will be well to modified 'self.conductivity = bd.array(conductivity)'. |
thanks @zaneky , I made the proposed change. Should be available in fdtd 0.2.8. |
* Update 00-quick-start.ipynb Should be a typo here for the grid-spacing * Bump version: 0.2.6 → 0.2.7 * fix setting of conductivity in objects.py (flaport#55) * Bump version: 0.2.7 → 0.2.8 --------- Co-authored-by: Floris Laporte <[email protected]> Co-authored-by: TTstone <[email protected]>
I've tried a minimal example:
But I'm getting this runtime error:
The text was updated successfully, but these errors were encountered: