onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.34k stars 626 forks source link

After converting my PyTorch model to Tensorflow, the output prediction changes #243

Open laurence-lin opened 3 years ago

laurence-lin commented 3 years ago

I'd got a dog image, and I attempt to use a Pytorch model to classify, then convert it to ONNX and to Tensorflow type.

I expect to get a same classification result, since it's originally the same model. However, the Pytorch model outputs "tennis_ball" class while Tensorflow model outputs "Samoyed" class.

Based on the true label, I suppose the Tensorflow model is more accurate, but that result confused me. Why would the same model perform differently?

How could I do to make it static for the model performance?

Here is my working process: https://colab.research.google.com/drive/1pBU_pYdmBHPEPf2C5fRTGkP_cs5kxL0e?usp=sharing

yuslepukhin commented 3 years ago

You might get a better response at github.com/pytorch/pytorch