We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu22.04 原始模型是2分类模型 mnn推理代码: def inference(model_path, input_format, input_data):
interpreter = MNN.Interpreter(model_path) session = interpreter.createSession() input_tensor = interpreter.getSessionInput(session) tmp_input = MNN.Tensor(input_format, MNN.Halide_Type_Float, np.float32(input_data), MNN.Tensor_DimensionType_Caffe) input_tensor.copyFrom(tmp_input) interpreter.runSession(session) # interpreter.runSessionWithCallBackInfo(session, begin_callback, end_callback) output_tensor = interpreter.getSessionOutput(session) # 获得模型的输出 # out_put_1 = interpreter.getSessionOutput(session,"/bneck/bneck.3/act3/Mul_output_0") # print(out_put_1) tmp_output = MNN.Tensor((2), # 用来做输出的临时变量 MNN.Halide_Type_Float, np.ones([2]).astype(np.float32), MNN.Tensor_DimensionType_Caffe) output_tensor.copyToHostTensor(tmp_output) # 将模型的输出给 tmp_output 变量 x = tmp_output.getNumpyData()
输出结果: [4.1752697e-38 0.0000000e+00] mnn的结果基本上都为0 onnx的输出结果: [ 1.1735201 -0.9136288],onnx的结果正确 onnx和mnn模型的输入已经确定是一致的
The text was updated successfully, but these errors were encountered:
No branches or pull requests
平台(如果交叉编译请再附上交叉编译目标平台):
Ubuntu22.04
原始模型是2分类模型
mnn推理代码:
def inference(model_path, input_format, input_data):
输出结果:
[4.1752697e-38 0.0000000e+00]
mnn的结果基本上都为0
onnx的输出结果:
[ 1.1735201 -0.9136288],onnx的结果正确
onnx和mnn模型的输入已经确定是一致的
The text was updated successfully, but these errors were encountered: