Skip to content

Commit 526cbe5

Browse files
authored
Update saveloadrun_tutorial.py (pytorch#1719)
* Update saveloadrun_tutorial.py Removes content. * Update saveloadrun_tutorial.py * Update saveloadrun_tutorial.py * Update saveloadrun_tutorial.py
1 parent 44bd518 commit 526cbe5

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

beginner_source/basics/saveloadrun_tutorial.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"""
1717

1818
import torch
19-
import torch.onnx as onnx
2019
import torchvision.models as models
2120

2221

@@ -58,25 +57,7 @@
5857
########################
5958
# .. note:: This approach uses Python `pickle <https://docs.python.org/3/library/pickle.html>`_ module when serializing the model, thus it relies on the actual class definition to be available when loading the model.
6059

61-
#######################################################################
62-
# Exporting Model to ONNX
63-
# -----------------------
64-
# PyTorch also has native ONNX export support. Given the dynamic nature of the
65-
# PyTorch execution graph, however, the export process must
66-
# traverse the execution graph to produce a persisted ONNX model. For this reason, a
67-
# test variable of the appropriate size should be passed in to the
68-
# export routine (in our case, we will create a dummy zero tensor of the correct size):
69-
70-
input_image = torch.zeros((1,3,224,224))
71-
onnx.export(model, input_image, 'model.onnx')
72-
73-
###########################
74-
# There are a lot of things you can do with ONNX model, including running inference on different platforms
75-
# and in different programming languages. For more details, we recommend
76-
# visiting `ONNX tutorial <https://github.com/onnx/tutorials>`_.
77-
#
78-
# Congratulations! You have completed the PyTorch beginner tutorial! Try
79-
# `revisting the first page <quickstart_tutorial.html>`_ to see the tutorial in its entirety
80-
# again. We hope this tutorial has helped you get started with deep learning on PyTorch.
81-
# Good luck!
82-
#
60+
#######################
61+
# Related Tutorials
62+
# -----------------
63+
# `Saving and Loading a General Checkpoint in PyTorch <https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_a_general_checkpoint.html>`_

0 commit comments

Comments
 (0)