I’ve tried this tutorial with newest TVM source code, but replace the get_network
with my ONNX model as below
import onnx
onnx_model = onnx.load('ShuffleNetV2_opt9_sim.onnx')
input_name = "image"
shape_dict = {input_name: [1, 3, 224, 224]}
mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
data_shape = [1, 3, 224, 224]
out_shape = [1, 1000]
# mod, params, data_shape, out_shape = get_network(model_name, batch_size)
# tasks = autotvm.task.extract_from_program(
# mod["main"], target=target, params=params, ops=(relay.op.get("nn.conv2d"),)
# )
tasks = autotvm.task.extract_from_program(mod["main"], target=target, params=params, ops=(relay.op.get("nn.conv2d"),))
After long time analysis, it ends with throwing a error which I don’t know how to solve
File "auto_tune_test1.py", line 213, in <module>
tune_and_evaluate(tuning_option)
File "auto_tune_test1.py", line 190, in tune_and_evaluate
tune_graph(mod["main"], data_shape, log_file, graph_opt_sch_file)
File "auto_tune_test1.py", line 163, in tune_graph
executor.run()
File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/dynamic_programming_tuner.py", line 207, in run
self._backward()
File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/dynamic_programming_tuner.py", line 106, in _backward
states_list, aligned_node_list = DPStage.align_states(
File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/dynamic_programming_stage.py", line 366, in align_states
input_node_states = np.broadcast_to(input_node_states, aligned_shape)
File "<__array_function__ internals>", line 5, in broadcast_to
File "/ssd5/anaconda3/lib/python3.8/site-packages/numpy/lib/stride_tricks.py", line 180, in broadcast_to
return _broadcast_to(array, shape, subok=subok, readonly=True)
File "/ssd5/anaconda3/lib/python3.8/site-packages/numpy/lib/stride_tricks.py", line 123, in _broadcast_to
it = np.nditer(
ValueError: iterator is too large
Also tried other tuner, ga
, random
, same error happend, call for help, thanks in advance~