I have double checked the type and made sure the NHWC -> NCHW is applied:
```
    assert input_type == "uint8", "Quantized models use uint8 input_type"

    mod, params =\
        relay.frontend.from_tflite(tflite_model,
                                   shape_dict={input_name: dshape},
                                   dtype_dict={input_name: input_type})
    #
    # Assume model from TFLite is NHWC, convert to NCHW
    #
    logging.warning("Applying NHWC to NCHW transformation")
    #
    # Dump Relay code
    #
    print(mod["main"].body, file=open('relay_NHWC.txt', 'w'))
    # This is the transformation pass
    with relay.build_config(opt_level=3):
        seq = tvm.transform.Sequential([
            relay.transform.RemoveUnusedFunctions(),
            relay.transform.ConvertLayout(layout)
        ])
        mod = seq(mod)
    #
    # Dump Relay code
    #
    print(mod["main"].body, file=open('relay_NCHW.txt', 'w'))
```
Note that I added `with relay.build_config(opt_level=3):` surrounding the 
transformation. I think I was missing that on my original post.





---
[Visit 
Topic](https://discuss.tvm.ai/t/autotvm-task-extract-from-program-in-tflite/6578/14)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/160afccf762b0c18e3132ead34a56b4dc145e76e6065130569bf71f8c69c44e2).

Reply via email to