Open st186 opened 5 years ago
@nerox8664 This happens because in operation_layers
, and probably in other places too, the fake_input_layer
parameter for ensure_tf_type
isn't set.
I could go over all function the coming days and send a PR if you want. (Also happy if you do that ofc ;))
Error -
Traceback (most recent call last): File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/keras/engine/base_layer.py", line 279, in assert_input_compatibility K.is_keras_tensor(x) File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 474, in is_keras_tensor str(type(x)) + '. ' ValueError: Unexpectedly found an instance of type <class 'NoneType'>`. Expected a symbolic tensor instance.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "tf-onnx-pytorch-keras.py", line 30, in k_model = onnx_to_keras(onnx_model, ['input']) File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/onnx2keras/converter.py", line 146, in onnx_to_keras node_name File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/onnx2keras/operation_layers.py", line 184, in convert_split input_0 = ensure_tf_type(layers[node.input[0]]) File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/onnx2keras/utils.py", line 42, in ensure_tf_type return lambda_layer(fake_input_layer) File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/keras/engine/base_layer.py", line 414, in call self.assert_input_compatibility(inputs) File "/home/pat-011/.virtualenvs/onnx/lib/python3.6/site-packages/keras/engine/base_layer.py", line 285, in assert_input_compatibility str(inputs) + '. All inputs to the layer ' ValueError: Layer lambda_1 was called with an input that isn't a symbolic tensor. Received type: <class 'NoneType'>. Full input: [None]. All inputs to the layer should be tensors.