Skip to content

Mismatching Pytorch Model Output vs Converted Core ML Model #489

@HussainHaris

Description

@HussainHaris

I fine tuned and trained a resnet50 on Pytorch for 8 labels instead of 1000.
When testing the model/passing in images on Pytorch I get the correct tensor of probabilities as seen below.
Screen Shot 2019-10-14 at 12 25 31 PM

On the Core ML model I get 0 for everything except for one label("living room") every single time, in which case I get 1. See below
Screen Shot 2019-10-14 at 12 26 00 PM

Why could they not be matching? I've compared the resnet50 model provided by Apple converted in CoreML to mine converted from Pytorch -> ONNX -> CoreML in Netron and I don't understand why I'm getting mismatching confidence values from pytorch vs CoreML.

Thank you in advance!

System/Model Information + Conversion Snippets

  • Mac OS 10.14

Screen Shot 2019-10-14 at 12 28 45 PM

Screen Shot 2019-10-14 at 12 25 48 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    NN backend onlyAffects only the NN backend (not MIL backend)awaiting responsePlease respond to this issue to provide further clarification (status)questionResponse providing clarification needed. Will not be assigned to a release. (type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions