mahfuzalhasan / Elbit_Experiments

0 stars 0 forks source link

Activity Recognition Work: Incompatible PyTorch Files - Please Help? #1

Open gottalikeengineering opened 3 years ago

gottalikeengineering commented 3 years ago

Mahfuz:

I hope you are doing well. I’m not certain this message will reach you, given I believe you moved on from UCF. If you receive this, we are finally integrating the Activity Recognition work you did.

However, I am having issues with compatibility between the .pth model files I have (which I believe were the latest files you uploaded) and the Python code modules “model_classification.py” or “model_partial_class.py”.

Basic issues are (for color and grayscale):

1. .pth files have different names layers like “Module.Mixed_3b.b1a.bn.bias”, “Module.Mixed_3b.b1a.bn.weight” etc.. versus what the Python code modules are expecting like “mixed_3b.branch_0.0.batch3d.bias”, “mixed_3b.branch_0.0.batch3d.bias”, etc.
2. I created a script that updated the .pth layer name convention to match the Python code module convention, but there are still issues such as: missing layers in .pth including “encoder_last_3”, “encoder_last_5”, “encoder_last_7”, and “encoder_last_1x1”.
3. I commented out “encoder_last_3”, “encoder_last_5”, “encoder_last_7”, and “encoder_last_1x1” within the Python code module to see if I could just ignore these layers, but there is yet another issue where .pth file contains a “logits.conv3d.weight” with dimensions [5, 1024, 1, 1, 1] versus Python code module’s similar “output_classification_conv.conv3d.weight” which expects dimensions of [34, 1024, 3, 3, 3].

Is is possible for you to upload the correct .pth files? I can’t access the old UCF link you sent in August 2020.

I really appreciate any help you might be able to offer.

Thanks,

ptirupat commented 3 years ago

Hello Jonathan,

  1. "Module" is added to the layer name when the model is pushed to the GPU. What you are doing to handle this is correct.

2 and 3. When you load the weights you can specify "strict=False". This will load the weights for only the layers where they fit the expected dimension.

I hope this helps.

gottalikeengineering commented 3 years ago

Hello, Praveen. Thank you for your reply. Regarding 2 & 3, I'm actually missing the pre-trained layers and was hoping I could get an updated set of *.pth files. The original ones I was provided don't have these. I'm currently undergoing a deployment evaluation of the code before I dig into re-training.

Thoughts?