You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
523 B

import torch
import numpy as np
model_1 = torch.load('/home/fhw/code/ViTPose/checkpoints/sam/sam_vit_b_01ec64.pth')
model_2 = torch.load('/home/fhw/code/ViTPose/work_dirs/ViTSam_base_coco_256x192/best_AP_epoch_1.pth')
param_1 = model_1['image_encoder.pos_embed'].numpy()
param_2 = model_2['state_dict']['backbone.sam_vit.pos_embed'].numpy()
# for name, param in model_2.items():
# print(name)
# print(model_2['state_dict']['backbone.sam_vit.pos_embed'])
is_equal = np.array_equal(param_1, param_2)
print(is_equal)