Closed tsaycal closed 2 years ago
If you have the onnx model (converted from Torch) you can use load_onnx_neural_network(onnx_model, input_bounds)
without first writing to a file. Your input bounds dictionary looks good if the input of the NN is a 1-dimensional vector.
Can you check your version of Pyomo? You have to upgrade to version 6.2 to support dictionary bounds. Regardless, we should update OMLT requirements in the setup file.
Using the load_onnx_neural_network(onnx_model, input_bounds)
produces the same error.
The input is 1-dimensional:
Running input_layer = list(network_definition.input_layers)[0]; print(input_layer.input_indexes)
produces:
[(0,), (1,), (2,), (3,), (4,) ..., (780,), (781,), (782,), (783,)]
Upgrading to Pyomo 6.2 fixed this issue. Thanks @jalving @fracek !
I am confused about what format of input bounds should be passed with an onnx model to omlt. Trying a list or a dictionary:
or
Attempting to create the omlt model with either:
Results in:
ValueError: Variable 'bounds' keyword must be a tuple or function