Hello. I’m trying to run a very basic model that just applies 2x-1 rule to a number.
The model itself has one Dense layer (Dense(units=1, input_shape=[1])) and when called using Keras API directly (model.predict([10.0])) works perfectly.
However when I’ve imported the model as onnx into Unity and ran simple test I’ve got a warning:
Given input shape: (1) is not compatible with model input shape: (unk__11, 1) for input: dense_input
I’m feeding input like this:
float data = new float { 10f };
TensorShape shape = new TensorShape(1);
TensorFloat tensor = new TensorFloat(shape, data);
Debug.Log(“EXECUTE”);
worker = WorkerFactory.CreateWorker(BackendType.GPUCompute, runtimeModel, verbose: true);
worker.Execute(tensor);
Debug.Log(“RESULT”);
TensorFloat outputTensor = worker.PeekOutput() as TensorFloat;
Also tried to feed input just like new TensorFloat(10f) - no result.
I’m wondering what am I missing in conversion from an input number to (unk__11, 1) format.