File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
onnxmltools/convert/keras/shape_calculators Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 55# --------------------------------------------------------------------------
66
77import keras
8+ from distutils .version import StrictVersion
89from ...common ._registration import register_shape_calculator
910
1011
@@ -18,8 +19,10 @@ def calculate_lazy_output_shapes(operator):
1819register_shape_calculator (keras .layers .advanced_activations .ThresholdedReLU , calculate_lazy_output_shapes )
1920register_shape_calculator (keras .layers .advanced_activations .ELU , calculate_lazy_output_shapes )
2021register_shape_calculator (keras .layers .advanced_activations .PReLU , calculate_lazy_output_shapes )
21- # TODO:Following layer is not supported by the checked-in keras version and requires an upgrade of the checked-in keras
22- # register_shape_calculator(keras.layers.advanced_activations.Softmax, calculate_lazy_output_shapes)
22+ if StrictVersion (keras .__version__ ) >= StrictVersion ('2.1.3' ):
23+ register_shape_calculator (keras .layers .advanced_activations .Softmax , calculate_lazy_output_shapes )
24+ if StrictVersion (keras .__version__ ) >= StrictVersion ('2.2.0' ):
25+ register_shape_calculator (keras .layers .advanced_activations .ReLU , calculate_lazy_output_shapes )
2326
2427# Concate
2528register_shape_calculator (keras .layers .Concatenate , calculate_lazy_output_shapes )
You can’t perform that action at this time.
0 commit comments