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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error occured when re_training graph classifier #11

Open
callmewanzi opened this issue Jan 17, 2025 · 1 comment
Open

error occured when re_training graph classifier #11

callmewanzi opened this issue Jan 17, 2025 · 1 comment

Comments

@callmewanzi
Copy link

Hi, thanks for your code.🙂
when I try to train the node classifier through the instruction
python3 ./molgrapher/scripts/train/train_graph_classifier.py
the below error accurred
Original Traceback (most recent call last): ... File "MolGrapher/molgrapher/datasets/dataset_graph.py", line 162, in __getitem__ molecular_graph = self.get_molecular_graph(image, keypoints, molecule) File "MolGrapher/molgrapher/datasets/dataset_graph.py", line 46, in get_molecular_gr aph molecular_graph = MolecularGraph(self.config).from_rdkit_molecule(molecule, keypoints) File "MolGrapher/molgrapher/utils/utils_graph.py", line 153, in from_rdkit_molecule "class": self.types_classes_bonds[bond_type], KeyError: 'SOLID'

The error will be disappeared when i replace "nb_bonds_classes": 6 with "nb_bonds_classes": 8 in MolGrapher/data/config_dataset_graph_2.json
But i don't know whether it's correct to replace.

Besides, there seems to be some problem with tensorboard files, when visualizing the file, the number of epoch is not changed with the number of training step. (like below)

Image

@lucas-morin
Copy link
Collaborator

Hello @callmewanzi,

Thanks for your interest in MolGrapher.
If I am not mistaken, I think you can train with both 6 or 8 bond classes, but it needs to be consistent with the configuration you used to generate the training dataset.

I only used the number of training steps but I think you could log self.trainer.current_epoch (as used here) to get the number of epoch.

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

No branches or pull requests

2 participants