Assert op.BuiltinOptionsType() == BuiltinOptions.ReshapeOptions AssertionError

Hi,

While converting the tflite model to relay module using below line of code :

mod, params = relay.frontend.from_tflite(tflite_model,
                                   shape_dict={input_tensor: input_shape},
                                  dtype_dict={input_tensor: input_dtype})

i am getting this error: assert op.BuiltinOptionsType() == BuiltinOptions.ReshapeOptions AssertionError

The tflite model (vgg facenet) is an quantized uint8 model which i converted from frozzen pb model to tflite model using tf lite command in tensorflow 2.3:

tflite_convert --output_file my_facenet_tf2_3_uint8.tflite --graph_def_file freeze_facenet.pb --enable_v1_converter --input_arrays “input” --input_shapes “1,160,160,3” --output_arrays “embeddings” --output_format TFLITE --mean_values 128 --std_dev_values 128 --default_ranges_min 0 --default_ranges_max 6 --inference_type QUANTIZED_UINT8 --inference_input_type QUANTIZED_UINT8

But when i converted my pb model to tflite model in tensorflow 2.2 (using same command) and then tried to convert the model to relay module everything works fine. Relay module is created successfully.

Please comment on this issue

Thanks

Should be fixed by this pr: https://github.com/apache/incubator-tvm/pull/6208. Please update tvm to the latest.

Hi @FrozenGene ,

i have updated the tvm. Now i am getting this error:

AttributeError: module 'tvm.target._ffi_api' has no attribute 'llvm_version_major'
During handling of the above exception, another exception occurred:

RuntimeError: LLVM version is not available, please check if you build with LLVM

Earlier i didnt had this issue. I download pre-built version of LLVM from (http://releases.llvm.org/download.html). From there i downloaded https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz. and then unzipped , modified build/config.cmake to add set(USE_LLVM /path/to/your/llvm/bin/llvm-config) After that i build the tvm.

Do i need to build the llvm from source instead of using prebuilt vesion.

Thank You.

could you list the information of cmake output when you build?That is to sat when you do cmake .. in the build directory

@FrozenGene I forgot to edit the cmake.config file. Everything works fine now .

Thank you