I have an orderdict and it contains all the pretrained weights and layer names. I would like to turn this orderdict back into a model class so can call it and run some transfer learning tests. I tried to directly convert it by using a dictionary comprehension with nn.ParameterDict but I got the error 'parameter name can\'t contain "."' So should I remove all the “.” in the key’s naming conventions? Eg layer1.weight to layer1_weight? What is the easiest way to do this?

image.png1649×292 67.1 KB