Skip to content

Commit

Permalink
Fix issue IntelLabs#26
Browse files Browse the repository at this point in the history
The checkpoint file:
examples/ssl/checkpoints/checkpoint_trained_channel_regularized_resnet20_finetuned.pth.tar
did not contain the "thinning recipe" while the weight tensor stored within the
checkpoint file have already been shrunk/thinned and this caused a mismatch.

PyTorch models are defined in code.  This includes the network architecture and
connectivity (which layers are used and what is the forward path), but also
the sizes for the parameter tensors and input/outputs.
When the model is created the parameter tensors are also created, as defined
or inferred from the code.
When a checkpoint is loaded, they parameter tensors are read from the checkpoint and
copied to the model's tensors.  Therefore, the tensors in the checkpoint and
in the model must have the same shape.  If a model has been "thinned" and saved to
a checkpoint, then the checkpoint tensors are "smaller" than the ones defined by
the model.  A "thinning recipe" is used to make changes to the model before copying
the tensors from the checkpoint.
In this case, the "thinning recipe" was missing.
  • Loading branch information
nzmora committed Jul 9, 2018
1 parent af4bf3d commit 51a7df3
Showing 1 changed file with 0 additions and 0 deletions.
Binary file not shown.

0 comments on commit 51a7df3

Please sign in to comment.