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

Exception not handled in train.py when --val_set is not provided #1

Open
djshen opened this issue Mar 5, 2020 · 1 comment
Open

Comments

@djshen
Copy link

djshen commented Mar 5, 2020

simpleNN/Python/train.py

Lines 305 to 308 in ad58af4

full_batch[0], mean_tr = normalize_and_reshape(full_batch[0], dim=config.dim, mean_tr=None)
val_batch[0], _ = normalize_and_reshape(val_batch[0], dim=config.dim, mean_tr=mean_tr)

If --val_set is not provided, val_data will be set to None, which will cause an exception like:

TypeError: 'NoneType' object is not subscriptable

This case is handled in the gradient_trainer function.

@quanpr
Copy link
Collaborator

quanpr commented Mar 5, 2020

Hi,

Thanks for your interest in trying our work. The exception is now handled. For your information, if no validation set is provided during the training phase, we will store the model in the last iteration for future prediction.

Best,
Pengrui

@quanpr quanpr closed this as completed Mar 5, 2020
@quanpr quanpr reopened this Mar 5, 2020
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