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

Changing entry.py for MisconfigurationException error #40

Closed
Sangyoon-Bae opened this issue Dec 1, 2021 · 7 comments
Closed

Changing entry.py for MisconfigurationException error #40

Sangyoon-Bae opened this issue Dec 1, 2021 · 7 comments

Comments

@Sangyoon-Bae
Copy link

Hi! This is Stella from Seoul National University, I'm getting a lot of help from your code.
I have a question about entry.py line 87.
Originally it has metric = 'valid_' + get_dataset(dm.dataset_name)['metric']
image
but when I run model, I faced error like this:
'pytorch_lightning.utilities.exceptions.MisconfigurationException: ModelCheckpoint(monitor='valid_mae') not found in the returned metrics: ['train_loss']. HINT: Did you call self.log('valid_mae', value) in the LightningModule?'

So I changed the line 87 as metric = 'train_loss'
image
and it runs well.

I'm quite afraid that I'm doing something wrong, is it right way to modify the code?
Here are some useful information for my project:

  1. task: regression
  2. input type : integer (originally continuous value, but discretized)
  3. target type : real value
  4. eval metric : rmse
  5. features from data.py
  •         'num_class': 1,
    
  •         'loss_fn': F.l1_loss,
    
  •         'metric': 'mae',
    
  •         'metric_mode': 'min',
    
@zhengsx
Copy link
Collaborator

zhengsx commented Dec 1, 2021

You can have a look about the usage of ModelCheckpoint in pytorch_lightning (see here). Basically it helps to monitor a self-defined metric during the training process.

@Sangyoon-Bae
Copy link
Author

Thank you for kind reply! I'm always grateful for your help :)
I used shell script in training ZINC dataset, and is this script just for pre-training?
If I want to validate model and test it, then should I do transfer learning like molhiv training example with pre-trained model which is made with this script?

@zhengsx
Copy link
Collaborator

zhengsx commented Dec 6, 2021

The reproduction of the ZINC results reported in our paper doesn't need pre-training. You can directly use the script. Btw, remember to test your model on ZINC testset, refer to #35 .

@Sangyoon-Bae
Copy link
Author

Then shell script in training ZINC dataset do training and validation, and should I use test dataset with another script to reproduce test MAE 0.122?

why ends so early

then loss in log bar (it is not ZINC data) means validation loss?

@Sangyoon-Bae
Copy link
Author

I solved the second problem! the loss in log bar means average loss about the past 100 batches in training.

@zhengsx
Copy link
Collaborator

zhengsx commented Dec 8, 2021

Then shell script in training ZINC dataset do training and validation, and should I use test dataset with another script to reproduce test MAE 0.122?

why ends so early

then loss in log bar (it is not ZINC data) means validation loss?

Yes, pls save your ckpt according to best val then test it on Testset.

@zhengsx
Copy link
Collaborator

zhengsx commented Dec 23, 2021

Close this issue due to inactive. Feel free to raise a new one or reopen this one for any further question.

@zhengsx zhengsx closed this as completed Dec 23, 2021
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