Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

schnet from_pretrained crashed #9159

Open
FUVHasagi opened this issue Apr 6, 2024 · 3 comments
Open

schnet from_pretrained crashed #9159

FUVHasagi opened this issue Apr 6, 2024 · 3 comments
Labels

Comments

@FUVHasagi
Copy link

馃悰 Describe the bug

the pretrained function returns ModuleNotFoundError: No module named 'schnetpack.atomistic.model'
Due to the changes in the schnetpack library, the model now belong to schnet.model instead of atomistic.model
Is there anything I can do with it, thank you
`import argparse
import os.path as osp

import torch
from tqdm import tqdm

from torch_geometric.datasets import QM9
from torch_geometric.loader import DataLoader
from torch_geometric.nn import SchNet

parser = argparse.ArgumentParser()
parser.add_argument('--cutoff', type=float, default=10.0,
help='Cutoff distance for interatomic interactions')
args = parser.parse_args()

path = osp.join(osp.dirname(osp.realpath(file)), '..', 'data', 'QM9')
dataset = QM9(path)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

for target in range(12):
model, datasets = SchNet.from_qm9_pretrained(path, dataset, target)
train_dataset, val_dataset, test_dataset = datasets

model = model.to(device)
loader = DataLoader(test_dataset, batch_size=256)

maes = []
for data in tqdm(loader):
    data = data.to(device)
    with torch.no_grad():
        pred = model(data.z, data.pos, data.batch)
    mae = (pred.view(-1) - data.y[:, target]).abs()
    maes.append(mae)

mae = torch.cat(maes, dim=0)

# Report meV instead of eV.
mae = 1000 * mae if target in [2, 3, 4, 6, 7, 8, 9, 10] else mae

print(f'Target: {target:02d}, MAE: {mae.mean():.5f} 卤 {mae.std():.5f}')`

Versions

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] pytorch-lightning==2.2.1
[pip3] torch==2.2.1
[pip3] torch-ema==0.3
[pip3] torch_geometric==2.5.2
[pip3] torchaudio==2.2.1
[pip3] torchmetrics==1.3.2
[pip3] torchvision==0.17.1
[pip3] triton==2.2.0
[conda] blas 2.116 mkl conda-forge
[conda] blas-devel 3.9.0 16_linux64_mkl conda-forge
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] libblas 3.9.0 16_linux64_mkl conda-forge
[conda] libcblas 3.9.0 16_linux64_mkl conda-forge
[conda] libjpeg-turbo 2.0.0 h9bf148f_0 pytorch
[conda] liblapack 3.9.0 16_linux64_mkl conda-forge
[conda] liblapacke 3.9.0 16_linux64_mkl conda-forge
[conda] mkl 2022.1.0 h84fe81f_915 conda-forge
[conda] mkl-devel 2022.1.0 ha770c72_916 conda-forge
[conda] mkl-include 2022.1.0 h84fe81f_915 conda-forge
[conda] numpy 1.26.4 py310hb13e2d6_0 conda-forge
[conda] pyg 2.5.2 py310_torch_2.2.0_cu118 pyg
[conda] pytorch 2.2.1 py3.10_cuda11.8_cudnn8.7.0_0 pytorch
[conda] pytorch-cuda 11.8 h7e8668a_5 pytorch
[conda] pytorch-lightning 2.2.1 pyhd8ed1ab_0 conda-forge
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torch-ema 0.3 pyhd8ed1ab_0 conda-forge
[conda] torchaudio 2.2.1 py310_cu118 pytorch
[conda] torchmetrics 1.3.2 pyhd8ed1ab_0 conda-forge
[conda] torchtriton 2.2.0 py310 pytorch
[conda] torchvision 0.17.1 py310_cu118 pytorch

@FUVHasagi FUVHasagi added the bug label Apr 6, 2024
@cycal1020
Copy link

Hello, I also encountered some problems while training SchNet. Can I communicate with you? Could you please provide a contact information, such as email?

@dbehera-zenon
Copy link

I have also encountered same problem, please provide us some solution.

Thanks

@rusty1s
Copy link
Member

rusty1s commented May 13, 2024

I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants