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

Errors in property iteration #12

Open
lajictw opened this issue Oct 27, 2023 · 9 comments
Open

Errors in property iteration #12

lajictw opened this issue Oct 27, 2023 · 9 comments

Comments

@lajictw
Copy link

lajictw commented Oct 27, 2023

Dear author,

Hi. When running train.py for qm9 dataset, I met the following errors.

Traceback (most recent call last):
File "D:\PaperCode\PS-VAE\src\train.py", line 133, in
config = {**common_config(args), **encoder_config(args, vocab), **predictor_config(args)}
File "D:\PaperCode\PS-VAE\src\utils\nn_utils.py", line 148, in common_config
'selected_properties': map_prop_to_idx(args.props)
File "D:\PaperCode\PS-VAE\src\evaluation\utils.py", line 129, in map_prop_to_idx
for p in props:
TypeError: 'NoneType' object is not iterable

I run the command as shown below。

python train.py --train_set ..\data\qm9\train.txt --valid_set ..\data\qm9\valid.txt --test_set ..\data\qm9\test.txt --vocab ..\ckpts\qm9\qm9_guaca_goal\qm9_bpe_101.txt --batch_size 32 --shuffle --alpha 0.1 --beta 0 --max_beta 0.01 --step_beta 0.002 --save_dir qm9_exps\ckpt\mine

I'm not sure if my input is legit because I'm not sure if the file selected for my vocab entry is correct. At your convenience can you add instructions for the folders qm9_guaca_dist and qm9_guaca_dist. This would help us to try to reproduce the results you have achieved on the qm9 dataset. Thanks! A screenshot is attached below.
image

@kxz18
Copy link
Collaborator

kxz18 commented Oct 27, 2023

Hi, sorry for the ambiguity in the instructions. The distribution learning shares the same procedure as in property prediction. The dataset and the vocab entry you are using is correct. I noticed that the error occurred because of the missing argument "props", so I've added a default value for the argument. Now it should be fine to first train the model and then validate it on the guacamol distribution learning benchmark.

@lajictw
Copy link
Author

lajictw commented Oct 27, 2023

Thanks for your help! I have a further question. Are all parameters required when run the train.py or only parameters with require mark are required

@kxz18
Copy link
Collaborator

kxz18 commented Oct 27, 2023

I've just updated the default parameters. Now it should be fine to only specify the arguments with require mark.

@lajictw
Copy link
Author

lajictw commented Oct 29, 2023

First, thanks for your help, But, actually, I mean the gpus parameter. If I leave it blank, it reports

AttributeError: 'NoneType' object has no attribute 'split'

If I set it equal to zero, as my cuda is available, it reports

TypeError: init() got an unexpected keyword argument 'gpus'

But in yout example script for training, you have the gpus parameters. This makes me really confuse.
Screenshot for your example script, my result with leaving parameter gpus blank, and result with setting it equal to zero is attached below.
image
image
image

A screenshot showing cuda is available is also attached below.
image

@kxz18
Copy link
Collaborator

kxz18 commented Oct 30, 2023

May I ask the version of pytorch-lightning you are using? The API of pytorch-lightning is changing. In version 1.5.7 which is specified in the requirements.txt, the trainer has an argument named "gpus" (see here). However, in latest versions, the argument has been changed to "accelerator" and "devices" (see here). Therefore I suspect the problem you encountered when setting "--gpus 0" is because of the incompatible version of pytorch-lightning.

@lajictw
Copy link
Author

lajictw commented Nov 21, 2023

Thank you! The information you provided was really helpful. Can you please facilitate the training setup data for the QM9 dataset. Because I see that the README document only provides training data for the ZINC dataset. And I couldn't find the ckpt document mentioned in your documentation.

@kxz18
Copy link
Collaborator

kxz18 commented Nov 21, 2023

Training data for QM9 is here, and checkpoints are provided here. "ckpts/{dataset}/{dataset}_guaca_dist/epoch{n}.ckpt" is used for guacamol distribution learning benchmark, where dataset can be qm9 or zinc250k. Similarly, the checkpoint in "{dataset}_guaca_goal" is used for guacamol goal-directed benchmark.

@lajictw
Copy link
Author

lajictw commented Nov 21, 2023

Thank you for your response! But what I would prefer to know, if possible, is the individual parameters of the QM9 training. For example learning rate, epoch value etc. thanks!

@kxz18
Copy link
Collaborator

kxz18 commented Nov 21, 2023

I just looked into the checkpoint directory and found what appeared to be the parameter settings as follows:

python train.py
--train_set ../data/qm9/train.txt
--valid_set ../data/qm9/valid.txt
--test_set ../data/qm9/test.txt
--vocab ../ckpts/qm9/qm9_guaca_dist/qm9_bpe_101.txt
--batch_size 32
--shuffle
--alpha 0.1
--beta 0
--max_beta 0.01
--step_beta 0.002
--kl_anneal_iter 1000
--kl_warmup 0
--lr 1e-3
--save_dir zinc_exps/ckpt/yours
--grad_clip 10.0
--epochs 6
--gpus 0
--props qed logp
--latent_dim 56
--node_hidden_dim 300
--graph_embedding_dim 400
--patience 3

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