atomistic-machine-learning / schnetpack

SchNetPack - Deep Neural Networks for Atomistic Systems
Other
791 stars 215 forks source link

Mismatched tensor sizes: #563

Closed ignaciomigliaro closed 1 year ago

ignaciomigliaro commented 1 year ago

Hello, currently I am trying to train on solid state data, I am getting an error with mismatched tensor sizes:

File "/scratch/.conda/envs/schnetpack/lib/python3.10/site-packages/torch/functional.py", line 74, in broadcast_tensors return _VF.broadcast_tensors(tensors) # type: ignore[attr-defined] RuntimeError: The size of tensor a (3) must match the size of tensor b (30) at non-singleton dimension 1

When I create the .db file, I printed the shape size are: Properties of molecule with id 0:

Attached is my config file. forces.txt

Thanks.

jnsLs commented 1 year ago

Hi @ignaciomigliaro ,

could you please provide the full error message? And which model are you training? SchNet, PaiNN, FieldSchNet, ...?

It looks like the dimension of stress is wrong. Could you try expanding it by the batch size? In your example case (of molecule 0) this would be 1x3x3 instead of 3x3.

Best, Jonas

jnsLs commented 1 year ago

We have updated (#564) the tutorial on materials to make clear which dimensions to use. I hope this solves your problem.

ignaciomigliaro commented 1 year ago

Thank you so much that fixed the error, although I am having problem training it just dies on epoch 0 showing infinite error.

jnsLs commented 1 year ago

Can you provide more information on the error? Does it still presist?