You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i'm trying to use the model with the weights for Veri I downloaded from your Drive to run simple inference on querys.
When I try to load the weights with load_param I get a key error in line 228 in multiheads_baseline.py ('KeyError: 'groupface.instance_fc.fc.weight')
Can someone help me?
Best regards!
The text was updated successfully, but these errors were encountered:
The error comes because the keys of the weights of veri does not match the keys in the model created in the code. In the paramdict (loaded from the veri weights), some keys have the 1st part as 'groupface' and in the state_dict ( which contains the weights of the model built in the code) , the same keys have the 1st part 'Multiheads'. (You can verify just by printing the keys)
This seems to be a naming issue only as dimensions of the values match .
So to fix the key error you can add a line of code to make the key names equal. ( In ./track2_aicity_2021/lib/modeling/multiheads_baseline.py > class Baseline > load_param function)
y = i.replace('groupface','MultiHeads')
In the follwing manner :
for i in param_dict:
y = i.replace('module', 'base')
y = i.replace('groupface','MultiHeads') <<< add the line in the loop to make the key names equal
Hello,
i'm trying to use the model with the weights for Veri I downloaded from your Drive to run simple inference on querys.
When I try to load the weights with load_param I get a key error in line 228 in multiheads_baseline.py ('KeyError: 'groupface.instance_fc.fc.weight')
Can someone help me?
Best regards!
The text was updated successfully, but these errors were encountered: