Skip to content

Commit

Permalink
Fix the bug of compile checkpoint to tensorrt (#492)
Browse files Browse the repository at this point in the history
Closes #491

Signed-off-by: zhangkaili <zhang.kaili@zte.com.cn>
  • Loading branch information
KellyZhang2020 committed Jul 7, 2021
1 parent 9ba353a commit 1fdd069
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
from typing import Any, Mapping, NamedTuple, Optional, Sequence, List
import numpy as np
import caffe2.python.onnx.frontend
from caffe2.proto import caffe2_pb2
from . import repository
from .. import utilities
Expand Down Expand Up @@ -57,6 +56,8 @@ def compile_source(source: CaffeModelFile, config: Config) -> OnnxModel:
input_shape.insert(0, config.max_batch_size)
value_info[config.input_names[i]] = (config.input_type, input_shape)

import caffe2.python.onnx.frontend # pylint: disable=import-outside-toplevel

onnx_model = caffe2.python.onnx.frontend.caffe2_net_to_onnx_model(predict_net, init_net, value_info)

graph = onnx_model.graph # pylint: disable=no-member
Expand Down

0 comments on commit 1fdd069

Please sign in to comment.