Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

prediction is wrong with multiple input with mini deployment=13 #570

Open
xu-wang11 opened this issue May 9, 2020 · 0 comments
Open

prediction is wrong with multiple input with mini deployment=13 #570

xu-wang11 opened this issue May 9, 2020 · 0 comments
Labels
bug Unexpected behaviour that should be corrected (type)

Comments

@xu-wang11
Copy link

xu-wang11 commented May 9, 2020

🐞Describe the bug

A clear and brief description of what the bug is.

I have posted all the code and test data to the repo:

https://github.com/xu-wang11/SiamRPN-coreml.git

  • input:
    • image: shape(1, 3, 271, 271)
    • kernel_reg: shape(20, 512, 4, 4)
    • kernel_cls: shape(10, 512, 4, 4)
  • output:
    • out_reg: shape(1, 20, 19, 19)
    • out_cls: shape(1, 10, 19, 19)
      My pytorch model first is converted to onnx model, and convert the model to mlmodel
 mlmodel = convert(model=oonx_file, minimum_ios_deployment_target='13')
 mlmodel.save(coreml_file)

first I run the onnx model with onnxruntime

ort_session = onnxruntime.InferenceSession("siamrpn_update.onnx")
ort_inputs = {'x': instance_image.astype(np.float32), 'kernel_reg': x1['kernel_reg'], 'kernel_cls': x1['kernel_cls']}
ort_outs = ort_session.run(None, ort_inputs)

and the range of out_reg is (-0.27, 0.47)and the range of out_cls is (-10.37, 10.38)
then i run the mlmodel with coremltools

 x2 = update_model.predict({'x': instance_image, 'kernel_reg': x1['kernel_reg'], 'kernel_cls': x1['kernel_cls']},useCPUOnly=True)

and the range of out_reg is (-0.18, 0.25) and the range of out_cls is (-0.56, 0.75)

System environment (please complete the following information):

  • coremltools version 3.3
  • onnx-coreml version 1.3
  • OS MacOS
  • macOS version Catalina 10.15.4
  • How you install python anaconda
  • python version 3.6
  • any other relevant information:
@xu-wang11 xu-wang11 added the bug Unexpected behaviour that should be corrected (type) label May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Unexpected behaviour that should be corrected (type)
Projects
None yet
Development

No branches or pull requests

1 participant