Toybrick

pt转rknn的问题

zhw

注册会员

积分
107
发表于 2020-10-15 10:44:51    查看: 6180|回复: 1 | [复制链接]    打印 | 显示全部楼层
out = action_model.predict(pts, frame.shape[:2])这是我用人体关键点检测人体行为的模型,模型输入为关键点pts和图片的shape模型结构是这样的:weight_file = './Models/TSSTG/tsstg-model.pth'
graph_args = {'strategy': 'spatial'}
class_names = ['Standing', 'Walking', 'Sitting', 'Lying Down',
               'Stand up', 'Sit down', 'Fall Down']
num_class = len(class_names)
model = TwoStreamSpatialTemporalGraph(graph_args, num_class).to(device)
model.load_state_dict(torch.load(weight_file, map_location=device))
model.eval()这种模型如何转换??????print('--> Loading model')
weight_file = './Models/TSSTG/tsstg-model.pth'
graph_args = {'strategy': 'spatial'}
class_names = ['Standing', 'Walking', 'Sitting', 'Lying Down',
               'Stand up', 'Sit down', 'Fall Down']
num_class = len(class_names)
model = TwoStreamSpatialTemporalGraph(graph_args, num_class).to(device)
model.load_state_dict(torch.load(weight_file, map_location=device))
model.eval()
input1 = torch.randn(18, 2)
input2 = torch.randn(1, 2)
trace_model = torch.jit.trace(model, ((input1, input2),))
trace_model.save('pose.pt')
ret = rknn.load_pytorch('pose.pt', input_size_list=[input1, input2])这样会报错,求大神指点!!!!!!!!!
回复

使用道具 举报

zhw

注册会员

积分
107
 楼主| 发表于 2020-10-15 14:33:20 | 显示全部楼层
求大佬帮忙
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表