When certain older ONNX ops were executed by MDF (e.g. randomuniform or randomnormal), they would cause ONNX runtime to print an ugly warning. This was because we are using sklearn2onnx to create a graph with that singular op and then using it to generate the ONNX model for that graph and execute it. sklearn2onnx seems to always use the lowest supported opset for op which leads to an opset version 1 graph which onnxruntime warns is no longer supported. To fix this issue, we can overwrite the opset version if it is too low.
I also fixed some issue with tensorflow Keras examples. 1) Got rid of serialization\deserialization of the keras models as this was leading to errors. Now the keras_model.py file is simple exec'ed before running the keras_to_MDF example. This makes sure the model is in the namespace and we don't need to save the model at all. 2) It seems tensorflow has introduces a softmax_v2 activation function that was not supported. This caused the parameter representing the activation function to be missing from the graph leading to an execution error. keras_to_mdf should probable fail to export in this case rather than producing a model. 3) Re-enable Tensorflow tests on 3.11.
This PR mainly fixes two issues.
When certain older ONNX ops were executed by MDF (e.g. randomuniform or randomnormal), they would cause ONNX runtime to print an ugly warning. This was because we are using sklearn2onnx to create a graph with that singular op and then using it to generate the ONNX model for that graph and execute it. sklearn2onnx seems to always use the lowest supported opset for op which leads to an opset version 1 graph which onnxruntime warns is no longer supported. To fix this issue, we can overwrite the opset version if it is too low.
I also fixed some issue with tensorflow Keras examples. 1) Got rid of serialization\deserialization of the keras models as this was leading to errors. Now the keras_model.py file is simple exec'ed before running the keras_to_MDF example. This makes sure the model is in the namespace and we don't need to save the model at all. 2) It seems tensorflow has introduces a softmax_v2 activation function that was not supported. This caused the parameter representing the activation function to be missing from the graph leading to an execution error. keras_to_mdf should probable fail to export in this case rather than producing a model. 3) Re-enable Tensorflow tests on 3.11.