Hello. I want to convert the model from Caffe to PyTorch. Model is resnet50_1by2 custom dataset.
Variant 1. Using torch and loadcaffe converted model.
Result: not all layers were converted.
– warning: module ‘bn_stage0_block0_branch2c [type BatchNorm]’ not found
– warning: module ‘scale_stage0_block0_branch2c [type Scale]’ not found
– warning: module ‘eltwise_stage0_block0 [type Eltwise]’ not found
Variant 2. Install Caffe and convert params to numpy. Load numpy arrays to PyTorch.
Caffe -> PyTorch
conv_1_0 -> conv_1.weight
conv_1_1 -> conv_1.bias
bn_1_0 -> bn_1.running_mean
bn_1_1 -> bn_1.running_var
scale_1_0 -> bn_1.weight
scale_1_1 -> bn_1.bias
Result: All the sizes of layers coincide, architecture too. All weights correspond! PyTorch model working! But when I make the profiling, the result is different after each layer and as a result the values are completely wrong.
What could be wrong with the Variant 2?
P.S. Pictures for testing are the same, normalization too. 3x224x224 (0, 255)
More information here github