yuyangw / MolCLR

Implementation of MolCLR: "Molecular Contrastive Learning of Representations via Graph Neural Networks" in PyG.
MIT License
233 stars 57 forks source link

Abstract Class Error Message #24

Open AhmadHammad21 opened 1 year ago

AhmadHammad21 commented 1 year ago

When I run either the pretraining or fine-tuning files, I get this error. Traceback (most recent call last): File "molclr.py", line 199, in main() File "molclr.py", line 195, in main molclr.train() File "molclr.py", line 70, in train train_loader, valid_loader = self.dataset.get_data_loaders() File "C:\Users\user\Desktop\Skin Permeation\MolCLR\dataset\dataset.py", line 162, in get_data_loaders train_dataset = MoleculeDataset(data_path=self.data_path) File "C:\Users\user\anaconda3\envs\molclr\lib\typing.py", line 819, in new obj = super().new(cls) TypeError: Can't instantiate abstract class MoleculeDataset with abstract methods get, len

danielkaifeng commented 1 year ago

I have the same issue, I suspect this is related to the version of torch-geometry. This is my torch version: torch 2.0.1 torch-geometric 2.3.1 torch-scatter 2.1.1+pt20cu117 torchvision 0.15.2

dn-code-dev commented 1 year ago

I have the same issue as well. Have you solved this?

danielkaifeng commented 1 year ago

yes, I reinstall the whole env according to README, it works for me now.

torch                 1.7.1+cu110
torch-geometric       1.6.3
torch-scatter         2.0.6
torch-sparse          0.6.9
torchvision           0.8.2+cu110
AhmadHammad21 commented 1 year ago

This is my torch version torch 1.13.1 torch-geometric 2.3.1 torch-scatter 2.1.1+pt113cu117 torch-sparse 0.6.17+pt113cu117 torchaudio 0.13.1 torchvision 0.14.1.

also I tried the env in README, and it still doesn't work too...

AhmadHammad21 commented 1 year ago

@danielkaifeng can you send me the all commands you used?, I have cuda 11.7 I'm following the same instructions, I keep getting the same.

I really appreciate that

danielkaifeng commented 1 year ago

I just copied and pasted commands from REAMDE.