martinwholtmon / IT3920-2024-Master-MSIT

Master project for MSIT 2024 - Towards Efficient Human Action Recognition: The Role of Keyframe Selection in Video Processing
MIT License
0 stars 0 forks source link

update logging and storing of checkpoints #106

Open martinwholtmon opened 2 weeks ago

martinwholtmon commented 2 weeks ago

Refactor the directory structure by utilizing self.version.

Instead of building the dataset/checkpoint name, create one folder and build the checkpoint and version naming based on that. For example: {model}_f{frames}-{repeated_aug}/{sampling_method}/{dataset}/

Where:

To store the checkpoints/models correctly, reflect the change to the models as well.

To implement this change:

    checkpoint_dir = os.path.join(project_dir_path, "checkpoints", name)  # remove "checkpoints"

    ModelCheckpoint(
            dirpath=checkpoint_dir,  # update path to the log folder (including name and version)

    # Train
    trainer_params = {
        ....
        "logger": TensorBoardLogger(
            save_dir=checkpoint_dir, name="", version=""
        ),

https://github.com/Lightning-AI/pytorch-lightning/blob/3dcf7130c554f4511c756ccbb4e3a417103d595d/pytorch_lightning/loggers/tensorboard.py#L110-L119