No module named 'parse_config' while tryhing to load checkpoint in PyTorch
I have a checkpoint file saved after training a model in Pytorch. I have to inspect it in a different module so I tried to load the checkpoint using the following code.
map_location = lambda storage, loc: storage
checkpoint = torch.load(&quot;model.pt&quot;, map_location=map_location)

But it is raising ModuleNotFoundError issue, which I couldn't find a way to resolve.
The error traceback  :
Traceback (most recent call last):
  File &quot;main.py&quot;, line 11, in &lt;module&gt;
    model = loadmodel(hook_feature)
  File &quot;/home/../model_loader.py&quot;, line 21, in loadmodel
    checkpoint = torch.load(settings.MODEL_FILE, map_location=map_location)
  File &quot;/home/../.conda/envs/envreporting/lib/python3.6/site-packages/torch/serialization.py&quot;, line 584, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File &quot;/home/../.conda/envs/envreporting/lib/python3.6/site-packages/torch/serialization.py&quot;, line 842, in _load
    result = unpickler.load()
ModuleNotFoundError: No module named 'parse_config'

I couldn't find an already existing issue relevant to this one.

Is it possible that you have used https://github.com/victoresque/pytorch-template for training the model ? In that case, the project also saves its config in the checkpoint and you also need to import parse_config.py file in order to load it.
