File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 10
10
# in PyTorch into the ONNX format and then load it into Caffe2. Once in
11
11
# Caffe2, we can run the model to double-check it was exported correctly,
12
12
# 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``.
15
19
#
16
20
17
21
# Some standard imports
23
27
import torch .utils .model_zoo as model_zoo
24
28
import torch .onnx
25
29
26
- import onnx
27
- import onnx_caffe2 .backend
28
-
29
30
30
31
######################################################################
31
32
# Super-resolution is a way of increasing the resolution of images, videos
@@ -121,6 +122,9 @@ def _initialize_weights(self):
121
122
# PyTorch are computing the same value for the network:
122
123
#
123
124
125
+ import onnx
126
+ import onnx_caffe2 .backend
127
+
124
128
# Load the ONNX GraphProto object. Graph is a standard Python protobuf object
125
129
graph = onnx .load ("super_resolution.onnx" )
126
130
You can’t perform that action at this time.
0 commit comments