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
Running Inference for a large organic molecule #155
Comments
Read the error and do what it says
…On Fri, Nov 25, 2022, 07:40 Nishi Maru ***@***.***> wrote:
I'm trying to run inference on an organic molecule of 47 atoms. I'm using
the equivariant transformer pretrained on the ANI-1 dataset. I passed
atomic numbers and the coordinates as tensors and am interested to get the
energy. On running the code, it is giving the following error:
Traceback (most recent call last):
File "//test1.py", line 35, in <module>
energy, forces = model(z, pos)
File "/opt/conda/envs/torchmd-net/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/torchmdnet/models/model.py", line 171, in forward
x, v, z, pos, batch = self.representation_model(z, pos, batch, q=q, s=s)
File "/opt/conda/envs/torchmd-net/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/torchmdnet/models/torchmd_et.py", line 161, in forward
edge_index, edge_weight, edge_vec = self.distance(pos, batch)
File "/opt/conda/envs/torchmd-net/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/torchmdnet/models/utils.py", line 221, in forward
assert not (
AssertionError: The neighbor search missed some atoms due to max_num_neighbors being too low. Please increase this parameter to include the maximum number of atoms within the cutoff.
—
Reply to this email directly, view it on GitHub
<#155>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3KUORZ4XGAWNEKW3RJDQLWKBNMNANCNFSM6AAAAAASLAEGSA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Increased the max_num_neighbour value from 32 (default) to 64, 128, 256. But it does not solve the error. |
Are you sure your coordinates are in Angstrom and not nanometers? That would increase the density by enough to make it unusable. |
yes, The coordinates are in Angstrom. |
Actually this should not matter. If your molecule is 47 atoms, setting the max_num_neighbour to anything above 47 would trivially solve it anyway. Can you paste here |
correction: molecule has 48 atoms.
|
I see you are running it from a custom script. Can you show me how you set the max_num_neighbour attribute? Or the whole script even better. |
I'm running the inference code mentioned in the examples. I'm passing the atomic coordinates as tensor (not using random function). I changed the cut off values in the files mentioned in the error.
|
You are not supposed to modify the source code, changing the function argument defaults would probably not do anything if the caller is passing a specific value to it. You should set it in load_model. I guess the documentation is not very clear on that. model = load_model("ANI1-equivariant_transformer/epoch=359-val_loss=0.0004-test_loss=0.0120.ckpt", derivative=True, max_num_neighbors=50) |
Thanks, Stefan. It worked. |
Great to hear that :) |
I'm trying to run inference on an organic molecule of 47 atoms. I'm using the equivariant transformer pretrained on the ANI-1 dataset. I passed atomic numbers and the coordinates as tensors and am interested to get the energy. On running the code, it is giving the following error:
The text was updated successfully, but these errors were encountered: