Closed neumannoskar closed 1 year ago
Hi I guess you need to install the package 'numpy' in your python environment. Take a look at the following link Hope this helps
Hey, thank's for the quick reply. That's is not the problem, since the script logistic_equation_1d.py
would produce an error earlier when trying to import numpy in line 7.
So the package 'numpy' is definitely installed.
Hi
I found also this link helpful
On 04/08/22 10:57, neumannoskar wrote:
Hey, thank's for the quick reply. That's is not the problem, since the script |logistic_equation_1d.py| would produce an error earlier when trying to import numpy in line 7.
So the package 'numpy' is definitely installed.
— Reply to this email directly, view it on GitHub https://github.com/madagra/basic-pinn/issues/1#issuecomment-1204966971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNETHMGXROU2HVF6RGADPLVXOAYBANCNFSM55RTH3YQ. You are receiving this because you commented.Message ID: @.***>
I found this post already, but unfortunately this version of torch is not available anymore. Trying to downgrade produces:
ERROR: Could not find a version that satisfies the requirement torch==0.9.1 (from versions: 1.11.0, 1.12.0)
ERROR: No matching distribution found for torch==0.9.1
Hello,
I pinned the version in the requirements.txt
file, but it is unnecessary. You can try to install the dependencies manually yourself in a virtual environment:
python -m venv .env
source .env/bin/activate
pip install numpy torch matplotlib
Try then to execute the code again.
You are definitely right.
That piece of code is trying to convert the 'loss' torch tensor to a numpy array.
It sounds as if the numpy() method would not be available.
Are you using a CPU or a GPU?
Anyway try this
loss.detach().cpu().numpy()
On 04/08/22 10:57, neumannoskar wrote:
Hey, thank's for the quick reply. That's is not the problem, since the script |logistic_equation_1d.py| would produce an error earlier when trying to import numpy in line 7.
So the package 'numpy' is definitely installed.
— Reply to this email directly, view it on GitHub https://github.com/madagra/basic-pinn/issues/1#issuecomment-1204966971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNETHMGXROU2HVF6RGADPLVXOAYBANCNFSM55RTH3YQ. You are receiving this because you commented.Message ID: @.***>
I am going to close this issue since I assume the problem has been solved with the two comments above.
I've tried to use the example for the
logistic_equation_1d.py
. It produces following errorline 94, in train_model
loss_evolution.append(loss.detach().numpy())
RuntimeError: Numpy is not available
I'm using Python 3.10.4.
Thank's for any help.