Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-703] Describe onnx opsets and major version
Browse files Browse the repository at this point in the history
  • Loading branch information
KellenSunderland committed Jan 16, 2019
1 parent 331eaa2 commit 615ee40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ci/docker/install/ubuntu_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set -ex
apt-get update || true

# Avoid interactive package installers such as tzdata.
ENV DEBIAN_FRONTEND noninteractive
export DEBIAN_FRONTEND=noninteractive

apt-get install -y \
apt-transport-https \
Expand Down
15 changes: 12 additions & 3 deletions src/operator/contrib/nnvm_to_onnx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,19 @@ op::TRTParam ConvertNnvmGraphToOnnx(
}

ModelProto model_proto;
// Need to determine IR versions and features to support

// We're currently serializing our models in ONNX 3, opset 8 as it is best supported by the
// currently linked version of the onnx-tensorrt library.
// More information on ONNX versions and opsets can be found at:
// https://github.com/onnx/onnx/blob/master/docs/IR.md

auto opset_proto = model_proto.add_opset_import();
opset_proto->set_version(static_cast<int64>(8));
model_proto.set_ir_version(static_cast<int64>(3));
const int64 onnx_opset = 8;
const int64 onnx_major_version = 3;

// Declare our ONNX versions in our protobuf model.
opset_proto->set_version(onnx_opset);
model_proto.set_ir_version(onnx_major_version);

GraphProto* graph_proto = model_proto.mutable_graph();
auto subgraph_name_id = subgraph_count.fetch_add(1);
Expand Down

0 comments on commit 615ee40

Please sign in to comment.