I see. you are manually replacing the network keys.



 Mona_Jalal:

new_state_dict = collections.OrderedDict() 
for k, v in model_dic.items(): 
    name = k.replace('module.', '')# remove `module.` 
    new_state_dict[name] = v



when you use DataParallel, it needs keys prepended with ‘module.’.