I have trained LSTM network and want to do a performance comparison between 
Keras and TVM on my personal laptop CPU. For that, I am using 10 values to pass 
through the network directly.

data shape is [10,1,6]
######################################################################
        #model is loaded from the .h5 file

   
    data = test_X[0:10,:,:]
    shape_dict = {"lstm_1_input": data.shape}
    mod, params = relay.frontend.from_keras(model, shape_dict)
# compile the model
    target = "llvm"
    ctx = tvm.cpu(0)
    with tvm.transform.PassContext(opt_level=3):
        executor = relay.build_module.create_executor("graph", mod, ctx, target)

    print("Test Data Shape = ",data.shape)
    dtype = "float32"
    data2 = data.astype(dtype)
    tvm_out = executor.evaluate()(tvm.nd.array(data2), **params)
    print(tvm_out)
    top1_tvm = np.argmax(tvm_out.asnumpy()[0])
######################################################################

For the above code, I am getting below error 

Check failed: *axis_ptr == 1 (10 vs. 1) : cannot squeeze axis with dimension 
not equal to 1.

Its basically feeding the TVM multiple inputs simultaneously.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/cannot-squeeze-axis-with-dimension-not-equal-to-1/8370/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/5619f4c832146e46a7b89726fa8ad6f2bfd7dfc91f9a3c28f3d4cebae9725601).

Reply via email to