Hi, I’m trying to compile a mobilenet v1_0.5_128 quantified TFLite model with TVM 0.12.0 and TVM 0.14.dev0 for raspb4 target and pynq target (Xilinx), but I keep getting this LLVM error: LLVM ERROR: Cannot select: intrinsic %llvm.aarch64.neon.uaddlp
Aborted
I am using LLVM 16, but I also tried building TVM with LLVM 15, LLVM 14 and LLVM 10 but keep getting the same error.
Note: I used to work with TVM 0.10.0 and did not face this error before, it was working well.
Here is my code, it is inspired by TVM tutorials:
import tvm
import tvm.relay as relay
from tvm.contrib.download import download_testdata
from PIL import Image
import numpy as np
from scipy.special import softmax
#define the target and the compiler
target= tvm.target.arm_cpu("rasp4b")
tflite_model_buf = open("mobilenet_v1_0.5_128_quant.tflite", "rb").read()
# Get TFLite model from buffer
try:
import tflite
tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite.Model
tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
#get the test image
img_url = "https://s3.amazonaws.com/model-server/inputs/kitten.jpg"
img_path = download_testdata(img_url, "imagenet_cat.png", module="data")
# Resize it to 128x128
resized_image = Image.open(img_path).resize((128, 128))
img_data = np.asarray(resized_image).astype(np.uint8)
# Normalize according to the ImageNet input specification
img_data_final = np.expand_dims(img_data, axis=0)
#create the portable function func
shape_dict = {"input": img_data_final.shape}
dtype_dict = {"input": img_data_final.dtype.name}
mod, params = relay.frontend.from_tflite(tflite_model, shape_dict,dtype_dict)
#compile
with tvm.transform.PassContext(opt_level=3):
lib = relay.build(mod, target, params=params)
# Save the library at local directory
lib.export_library("tflmodel.tar")