Based on the error message it seems that
torch.load('MaskModelParams.pth', map_location=device)

returns a MaskRCNN object, not the state_dict and would thus fail, so you could double check that MaskModelParams.pth is indeed containing the state_dict.