question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass filename components into Checkpoint.load_objects

See original GitHub issue

🚀 Feature

Currently, objects can be loaded like this:

from ignite.handlers import Checkpoint

Checkpoint.load_objects(to_load=to_load, checkpoint=checkpoint_fp)

It would be nice to have the following as an option:

from ignite.handlers import Checkpoint

checkpointer = Checkpoint(...)
checkpointer.load_objects(to_load=to_load, filename_components={"name": name, "global_step": global_step})

In other words, pass in components of self.filename_pattern. The Checkpoint object already has self.filename_pattern, self.filename_prefix, self.ext, and it should also have the dirname that is passed into __init__. So most of the components of constructing the filename are already defined in the Checkpoint object. Getting the user to recreate the full file path is unnecessary.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vfdev-5commented, Feb 21, 2022

@sdesrozis looks good to me as well. I was also wondering if we could make the method signature as

def reload_objects(self, to_load: Mapping, **filename_components, load_kwards: Optional[Dict] = None) -> None:

basically, fetching filename_components as kwargs and rarely used load_kwards as a dict

1reaction
vfdev-5commented, Feb 19, 2022

I see, that makes sense. Let me see what can be done for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkpoint — PyTorch-Ignite v0.4.10 Documentation
Helper method to apply load_state_dict on the objects from to_load . Filename components such as name, score and global state can be configured....
Read more >
ignite/checkpoint.py at master · pytorch/ignite - GitHub
This class stores a single file as a dictionary of provided objects to save. The filename is defined by ``filename_pattern`` and by default...
Read more >
checkpoint file name dynamically - MSDN - Microsoft
How do I pass checkpoint file name location dynamically ? For example. We have several SSIS packages and all of them using checkpoints....
Read more >
Splitting a Filename into Its Component Parts - Perl Cookbook ...
The fileparse function can be used to extract the extension. To do so, pass fileparse the path to decipher and a regular expression...
Read more >
Solved: help with a script - Check Point CheckMates
txt filename. but lately (maybe from some ver upgrade) it failed to save the filename with $hostname, so it's only save it with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found