Toybrick

标题: pt转rknn的问题 [打印本页]

作者: zhw    时间: 2020-10-15 10:44
标题: pt转rknn的问题
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    时间: 2020-10-15 14:33
求大佬帮忙




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3