Skip to content

Problem in plotting in Poisson tutorial on colab #393

@accdavlo

Description

@accdavlo

Describe the bug
The tutorial on Poisson does not produce a plot on Google colab.

Commitment
I was trying to run the code to have a simple PINN for a class, I'm not thinking to debug the code. I thank you in advance if you will debug it.

To Reproduce
https://colab.research.google.com/github/mathLab/PINA/blob/master/tutorials/tutorial2/tutorial.ipynb at the first plot cell.

Bug
I get this error
ValueError: only one element tensors can be converted to Python scalars
when running the tutorial on Poisson on google colab https://mathlab.github.io/PINA/_rst/tutorials/tutorial2/tutorial.html

Complete Error

ValueError                                Traceback (most recent call last)
[<ipython-input-4-da1f560dd1b4>](https://localhost:8080/#) in <cell line: 2>()
      1 plotter = Plotter()
----> 2 plotter.plot(solver=pinn)

13 frames
[/usr/local/lib/python3.10/dist-packages/torch/_tensor.py](https://localhost:8080/#) in __torch_function__(cls, func, types, args, kwargs)
   1510 
   1511         with _C.DisableTorchFunctionSubclass():
-> 1512             ret = func(*args, **kwargs)
   1513             if func in get_default_nowrap_functions():
   1514                 return ret

ValueError: only one element tensors can be converted to Python scalars```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions