-
Notifications
You must be signed in to change notification settings - Fork 18
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
getNeighborPairs error #68
Comments
I think the problem might be torch 1.12, for some reason the
|
I cannot reproduce this. NNPOps should work with 1.12 now, though. |
I have actually been cursed with this. from torch import ops
import site
ops.load_library(site.getsitepackages()[-1]+"/NNPOps/libNNPOpsPyTorch.so") It is strange, because while I observe the behavior described by @davkovacs, running pytest works. Pytest is able to load and call getNeighborPairs during the tests, but I cannot do so from a python script such as this one: import torch as pt
import numpy as np
import pytest
from NNPOps.neighbors import getNeighborPairs
device = 'cuda:0'
dtype = pt.float32
num_atoms = 100
# Generate random positions
positions = 10 * pt.randn((num_atoms, 3), device=device, dtype=dtype)
cutoff = float(5.0)
num_neighbors = num_atoms*num_atoms
neighbors, deltas, distances = getNeighborPairs(positions, cutoff=cutoff, max_num_neighbors=num_neighbors) I have no idea of what causes this or how to reproduce it. |
I think we just need to move the code to load the library? NNPOps/src/pytorch/SymmetryFunctions.py Lines 29 to 30 in 16543f9
It gets repeated in SymmetryFunction.py, CFConv.py, and BatchedNN.py. It doesn't appear in getNeighborPairs.py, so the library doesn't get loaded in that case. How about loading the library once, in the top level __init__.py? |
Ohhh so this is why the tests run, they must import one of those.
I do not know what the standard knowledge is on this, but that seems sensible. Let me test and I will PR. |
I am trying to use the new neighbourlist with pytorch 1.12.1. I have managed to install
NNPOps
via conda.If I check the PyTorch version it is 1.12, so that is fine.
If I try to import NNPOps that is also fine:
And it is event telling me it needs two positional arguments:
But when I actually specify those positional arguments I am getting the following error:
Does anyone perhaps know what might be going wrong?
A few relevant info about the environment:
Interestingly,
NNPOps
does not appear when I doconda list
.The text was updated successfully, but these errors were encountered: