HI
I recently upgraded TVM to the latest on git with all its sub-modules. I am using PyTorch 1.0 and ONNX 1.4.1. I was able to build TVM with target as “LLVM” on my Mac. Building and installation of both the C++ and python went smoothly.
I was trying to execute this script to load a ONNX model and instantiate the NNVM compiler using the steps listed in: (I just changed line 70 target to ‘llvm’)
However I am getting this error message:
>>> from PIL import Image
>>> img_url = 'https://github.com/dmlc/mxnet.js/blob/master/data/cat.png?raw=true'
>>> download(img_url, 'cat.png')
File cat.png existed, skip.
>>> img = Image.open('cat.png').resize((224, 224))
>>> img_ycbcr = img.convert("YCbCr") # convert to YCbCr
>>> img_y, img_cb, img_cr = img_ycbcr.split()
>>> x = np.array(img_y)[np.newaxis, np.newaxis, :, :]
>>> import nnvm.compiler
>>> target = 'llvm'
>>> input_name = sym.list_input_names()[0]
>>> shape_dict = {input_name: x.shape}
>>> with nnvm.compiler.build_config(opt_level=3):
... graph, lib, params = nnvm.compiler.build(sym, target, shape_dict, params=params)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/pallabdatta/nnvm_tvm_npcompiler/np-compiler/tvm/nnvm/python/nnvm/compiler/build_module.py", line 245, in build
tophub_context = autotvm.tophub.context(target)
File "/Users/pallabdatta/nnvm_tvm_npcompiler/np-compiler/tvm/python/tvm/autotvm/tophub.py", line 84, in context
best_context.load(os.path.join(AUTOTVM_TOPHUB_ROOT_PATH, filename))
File "/Users/pallabdatta/nnvm_tvm_npcompiler/np-compiler/tvm/python/tvm/autotvm/task/dispatcher.py", line 279, in load
for inp, res in records:
File "/Users/pallabdatta/nnvm_tvm_npcompiler/np-compiler/tvm/python/tvm/autotvm/record.py", line 168, in load_from_file
yield decode(row)
File "/Users/pallabdatta/nnvm_tvm_npcompiler/np-compiler/tvm/python/tvm/autotvm/record.py", line 116, in decode
row = json.loads(row)
File "/Users/pallabdatta/anaconda3/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/Users/pallabdatta/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/pallabdatta/anaconda3/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 426 (char 425)
>>>
Can you please help me why I am getting this error?! Thanks a lot in advance,
pallab