Skip to content

Commit

Permalink
fixed for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wjj19950828 committed Oct 10, 2022
1 parent 20eef55 commit 0680f32
Show file tree
Hide file tree
Showing 2 changed files with 1,621 additions and 2 deletions.
10 changes: 8 additions & 2 deletions x2paddle/decoder/onnx_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from x2paddle.core.graph import GraphNode, Graph
from x2paddle.decoder.onnx_shape_inference import SymbolicShapeInference
from onnx.checker import ValidationError
from onnx.checker import check_model
from onnx import helper, shape_inference
Expand Down Expand Up @@ -184,8 +185,13 @@ def __init__(self, onnx_model, input_shape_dict):
self.graph = onnx_model.graph
self.get_place_holder_nodes()
print("Shape inferencing ...")
onnx_model = shape_inference.infer_shapes(onnx_model)
self.graph = onnx_model.graph
try:
self.graph = SymbolicShapeInference.infer_shapes(
onnx_model, fixed_input_shape=self.fixed_input_shape)
except:
print('[WARNING] Shape inference by ONNX offical interface.')
onnx_model = shape_inference.infer_shapes(onnx_model)
self.graph = onnx_model.graph
print("Shape inferenced.")
self.build()
self.collect_value_infos()
Expand Down
Loading

0 comments on commit 0680f32

Please sign in to comment.