yuyangw / MolCLR

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

gin pretrained files cannot be loaded #1

Closed MarieOestreich closed 2 years ago

MarieOestreich commented 2 years ago

Hi, when trying to load the pre-trained GIN model with torch, load, we were facing an error. According to our google search it it due to a corrupted file. In Google Colab we get this error: ' RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory'

It would be great if you could re-upload the file. Thanks!

yuyangw commented 2 years ago

Hi, I checked the file and it can be correctly loaded on my side. Did you load the pre-trained model via model.load_state_dict(torch.load(PATH))?

MarieOestreich commented 2 years ago

Hi, thanks for your fast reply. We only tried to load the entire model with torch.load(PATH), which caused the error. Now I tried your proposed model.load_state_dict(torch.load(PATH)) and it works just fine.

Cheers!