You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by JJZOU via Apache TVM Discuss <no...@discuss.tvm.ai> on 2022/03/19 02:40:45 UTC
[Apache TVM Discuss] [Questions] Cannot find config for target=llvm -keys=cpu -link-params=0, workload=
I have the following warning when running TVM in Ubuntu on both X86 servers. Does anyone have the same problem? Is there a solution? Thank you.
Here's a simple piece of code I ran recently with the same warning:
> import onnx
> import time
> import tvm
> import numpy as np
> import tvm.relay as relay
> from PIL import Image
>
> onnx_model = onnx.load('mobilenetv2.onnx')
> mean = [123., 117., 104.]
> std = [58.395, 57.12, 57.375]
>
>
> def transform_image(image):
> image = image - np.array(mean)
> image /= np.array(std)
> image = np.array(image).transpose((2, 0, 1))
> image = image[np.newaxis, :].astype('float32')
> return image
>
> img = Image.open('./images/cat.png').resize((224, 224)).convert("RGB")
> x = transform_image(img)
> #print(x)
>
>
> #-------------------------------------------------------------------------------------------------------------------
>
> target = 'llvm'
> input_name = 'input.1'
> shape_dict = {input_name: x.shape}
>
> sym, params = relay.frontend.from_onnx(onnx_model, shape_dict)
>
> #print(sym,params)
> with relay.build_config(opt_level=3):
> intrp = relay.build_module.create_executor('graph', sym, tvm.cpu(0), target)
>
> dtype = 'float32'
>
> func = intrp.evaluate()
>
> output = func(tvm.nd.array(x.astype(dtype)), **params).asnumpy()
> print(output.argmax())
>
>
> since = time.time()
> for i in range(100):
> output = func(tvm.nd.array(x.astype(dtype)), **params).asnumpy()
> time_elapsed = time.time() - since
> print('Time elapsed is {:.0f}m {:.0f}s'.
> format(time_elapsed // 60, time_elapsed % 60))
![1647655034(1)|690x252](upload://oL7UMsSdvUwWajJ3nPgkUa0hxDp.png)
---
[Visit Topic](https://discuss.tvm.apache.org/t/cannot-find-config-for-target-llvm-keys-cpu-link-params-0-workload/12351/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/7fb4320e29944027365586afefd508e0bc26f36fc063b2d820e1e44ee3499ed3).