权重转换报错

import torch
import jittor as jt
clip = torch.load(‘abc.pth’).state_dict()

for k in clip.keys():
clip[k] = clip[k].float().cpu()
jt.save(clip, ‘a.pkl’)

报错:“Traceback (most recent call last):
File “/root/t.py”, line 3, in
clip = torch.load(‘abc.pth’).state_dict()
AttributeError: ‘dict’ object has no attribute ‘state_dict’”

去掉.state_dict()就能解决了