您好,生成离线模型时,cnmlSetFusionOpCoreVersion内的coreVersion需要指定为CNML_MLU220展开
非常感谢你解答了问题一,想请教对问题二看法,在MLU270平台上对yolov5 xxx.pt 模型在torch_mlu量化、逐层、融合后生成xxx.cambricon并python代码预测和画框,之前已经设置了ct.set_core_version(“MLU220”),输出pred框到目标是不正确,而且很多密密麻麻乱框; 我是否可以这么理解:此时模型为MLU220模型,在MLU270平台预测bbox是不准确的; 部分代码: # 融合部分 if opt.jit: print("### jit") # 边缘端MLU220 ct.set_core_version('MLU270') ct.save_as_cambricon("yolov5m_best_int8_" + str(batchsize) + "b_" + str(corenum) + "c_" + opt.offline_model) torch.set_grad_enabled(False) ct.set_core_number(corenum) trace_input = torch.randn(batchsize, 3, 640, 640, dtype=torch.float) input_mlu_data = trace_input.type(torch.HalfTensor).to(ct.mlu_device()) quantized_net = torch.jit.trace(quantized_net,input_mlu_data,check_trace = False) # 融合后预测pred img = img.type(torch.HalfTensor).to(ct.mlu_device()) img = img.to(ct.mlu_device()) pred = quantized_net(img)[0] pred=pred.data.cpu().type(torch.FloatTensor) print("pred.shape:",pred.shape) box_result = get_boxes(pred) pred = torch.tensor(box_result) print("MNS_pred:",pred) print("im0s.shape:",im0s.shape) res = box_result[0].tolist()展开
如果在使用pytorch生成220模型时报这个warning是正常的
如果在使用pytorch生成220模型时报这个warning是正常的
你好,加了ct.set_core_version(“MLU220”),有如下问题: 问题一,还是警告平台核心不同: [cnrtWarning] [18847] [Card : 0] The device you run is not the same as the platform in kernel! [cnrtWarning] [18847] [Card : 0] The device you run is MLU270, but the platform in kernel is MLU220! 问题二,ct.set_core_version(“MLU270”)输出pred框到目标是正确的,而ct.set_core_version(“MLU220”)输出pred框到目标是不正确,而且很多密密麻麻乱框;展开
您好,生成离线模型时,cnmlSetFusionOpCoreVersion内的coreVersion需要指定为CNML_MLU220展开
非常感谢
请登录后评论