Skip to content

Epoch is not saved to the Torch checkpoint #55

@martinlyra

Description

@martinlyra

Whenever predict_ros.py is run with our own trained data:

Loading ckpt from  /home/marcusmartin/artifacts/0/model_best_val.pth.tar
Traceback (most recent call last):
  File "predict_ros.py", line 109, in <module>
    tracker = Tracker(dataset_info, images_mean, images_std,ckpt_dir,trans_normalizer=dataset_info['max_translation'],rot_normalizer=dataset_info['max_rotation'])
  File "/home/marcusmartin/iros20-tracking/predict.py", line 152, in __init__
    print('pose track ckpt epoch={}'.format(checkpoint['epoch']))
KeyError: 'epoch'

The culprit seems to be

checkpoint_data = {'state_dict': self.model.state_dict()}

and
checkpoint_data = {'state_dict': self.model.state_dict()}

Our torch version when we trained the data was 2.0.1 - if you were using an older version, may I suggest you to add a requirements.txt too?

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