Closed tchang1997 closed 3 years ago
Update: for converting the models, the Resnet50 block sizes should be [3, 4, 6, 3]
, NOT [3, 8, 6, 3]
. The conversion works upon modifying the ir_csn_50
code above accordingly.
I have the same problem. It succeeds for irCSN_152, but it doesn't work for irCSN_50. KeyError: 'comp_0_conv_2_middle_w'.
Problem: Can't convert IR-CSN-50 Caffe2 model to PyTorch using modified version of conversion script. Expected behavior: Caffe2 model is converted to
.pth
format successfully Actual behavior: Shape mismatch occurs.Questions:
*.pkl
file storing the IR-CSN-50 model weights, or have I misspecified something?Details: I'm trying to convert the Caffe2 IR-CSN-50 checkpoint given here into the equivalent PyTorch model. I've run the conversion script on one of the provided IR-CSN-152 checkpoints successfully, but I can't seem to make the IR-CSN-50 conversion work.
I added the following code to
utilities/model_conversion/conversion_models.py
:This is directly based on the
ir_csn_152
function, replacing terms where necessary. I got the layer sizes from theip_csn_50
function. I also addedir_csn_50
to__all__
.However, when I run the following command (based on these commands) to convert the model...
I run into the following error:
Upon further inspection, the blob named
comp_7_conv_1_w
has size[256, 512, 1, 1, 1]
, but it is expected to have size[128, 512, 1, 1, 1]
.Thanks in advance!