Skip to content

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

@djshen

Description

@djshen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions