Skip to content

Commit 414a9df

Browse files
ezyangsoumith
authored andcommitted
Elaborate the install instructions more. (pytorch#133)
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
1 parent 27daa28 commit 414a9df

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

advanced_source/super_resolution_with_caffe2.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
# in PyTorch into the ONNX format and then load it into Caffe2. Once in
1111
# Caffe2, we can run the model to double-check it was exported correctly,
1212
# and we then show how to use Caffe2 features such as mobile exporter for
13-
# executing the model on mobile devices. For this tutorial, you will need to
14-
# install ONNX by following the instructions `here <https://github.com/onnx/onnx>`__
13+
# executing the model on mobile devices.
14+
#
15+
# For this tutorial, you will need to install `onnx <https://github.com/onnx/onnx>`__,
16+
# `onnx-caffe2 <https://github.com/onnx/onnx-caffe2>`__ and `Caffe2 <https://caffe2.ai/>`__.
17+
# You can get binary builds of onnx and onnx-caffe2 with
18+
# ``conda install -c ezyang onnx onnx-caffe2``.
1519
#
1620

1721
# Some standard imports
@@ -23,9 +27,6 @@
2327
import torch.utils.model_zoo as model_zoo
2428
import torch.onnx
2529

26-
import onnx
27-
import onnx_caffe2.backend
28-
2930

3031
######################################################################
3132
# Super-resolution is a way of increasing the resolution of images, videos
@@ -121,6 +122,9 @@ def _initialize_weights(self):
121122
# PyTorch are computing the same value for the network:
122123
#
123124

125+
import onnx
126+
import onnx_caffe2.backend
127+
124128
# Load the ONNX GraphProto object. Graph is a standard Python protobuf object
125129
graph = onnx.load("super_resolution.onnx")
126130

0 commit comments

Comments
 (0)