import torch | |
# 加载模型参数 | |
model_path = '/home/aiops/wangzh/zss/AlphaCLIP/train/final-negative-large-wiseconv/ckpt/iter_10000.pth' # 你的模型路径 | |
checkpoint = torch.load(model_path) | |
# 输出 checkpoint 内容 | |
# print("Checkpoint content:", checkpoint) | |
import pdb;pdb.set_trace() | |
# 如果 checkpoint 是一个包含模型参数的字典(例如state_dict) | |
if isinstance(checkpoint, dict): | |
for key, value in checkpoint.items(): | |
print(f"{key}: {value.shape}") | |
if 'cpe' in key: | |
print(value) | |
else: | |
print("The checkpoint does not contain a dictionary with parameters.") | |