Skip to content

Add a PyTorch to Tensorflow tutorial#68

Merged
houseroad merged 3 commits intoonnx:masterfrom
winnietsang:add-pytorch-to-tf-tutorial
Sep 25, 2018
Merged

Add a PyTorch to Tensorflow tutorial#68
houseroad merged 3 commits intoonnx:masterfrom
winnietsang:add-pytorch-to-tf-tutorial

Conversation

@winnietsang
Copy link
Copy Markdown
Contributor

Add an end-to-end tutorial that show user how to convert a PyTorch model to Tensorflow model

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 17, 2018

CLA assistant check
All committers have signed the CLA.

@houseroad houseroad merged commit df1b6be into onnx:master Sep 25, 2018
@winnietsang winnietsang deleted the add-pytorch-to-tf-tutorial branch September 25, 2018 23:50
@XiaodanLi001
Copy link
Copy Markdown

Hi, I have just run the PyTorch to Tensorflow tutorial with nothing changed. I want to test whether the generated pb file can generate a same result as pytorch model. So I input an image resized to (28,28). I have tried to input image after transform.ToTensor and put it into pytorch model. The generated output is not the same with the output = tf_rep.run(np.asarray(img, dtype=np.float32)[np.newaxis, np.newaxis, :, :]). So I also tried to put the 28x28 image into pytorch model directly, which can not generate a same result as tf output either. Do you have any suggestions to this problem?

@houseroad
Copy link
Copy Markdown
Member

@XiaodanLi001 you can do layer by layer comparison. The models seem not very deep. Manually insert ing some print statement should not be too hard. Also you can leverage tools like tensorboard. @winnietsang may have better suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants