提交 0680f324 编写于 作者: W wjj19950828

fixed for ci

上级 20eef555
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
from x2paddle.core.graph import GraphNode, Graph from x2paddle.core.graph import GraphNode, Graph
from x2paddle.decoder.onnx_shape_inference import SymbolicShapeInference
from onnx.checker import ValidationError from onnx.checker import ValidationError
from onnx.checker import check_model from onnx.checker import check_model
from onnx import helper, shape_inference from onnx import helper, shape_inference
...@@ -184,8 +185,13 @@ class ONNXGraph(Graph): ...@@ -184,8 +185,13 @@ class ONNXGraph(Graph):
self.graph = onnx_model.graph self.graph = onnx_model.graph
self.get_place_holder_nodes() self.get_place_holder_nodes()
print("Shape inferencing ...") print("Shape inferencing ...")
onnx_model = shape_inference.infer_shapes(onnx_model) try:
self.graph = onnx_model.graph 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.") print("Shape inferenced.")
self.build() self.build()
self.collect_value_infos() self.collect_value_infos()
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册