This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import re | |
phmodel = torch.load("phenobench_mask_rcnn_r50_fpn.pt", map_location=torch.device('cpu')) | |
oldmodel = phmodel['model_state_dict'] | |
newmodel = {} | |
for k in list(oldmodel.keys()): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bit Manipulation | |
& - and - both values are 1 | |
| - or - one or the other is 1 | |
^ - xor - if only one value is 1 | |
~ - not - flips the bit |