Conv1, Conv2 are names for layers (or in fact modules). Names of parameters look like Conv1.weight, Conv2.bias.
Sometimes your layer names are just numbers (e.g when you are using Sequential without specifying the names). Assuming what you want are the names of parameters (for loading or something), you could use model.state_dict().keys() to get all the names.
If a contains only the pre-trained weights, you could simply call a.keys() to get the names of all parameters because a is actually an OrderedDict object.
Hi while doing the torch.load() i am getting an error that MainModule is missing and its points the error to a serialization.py. I am using weights from https://github.com/ox-vgg/vgg_face2
Hii isalirezag,
Im new on torch and I loaded a model from .pth file and I have an OrderedDict object. My question is how can I use this object to do an object detection?
Thanks