Error happend while use `autotvm`

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 "", line 213, in <module>
  File "", line 190, in tune_and_evaluate
    tune_graph(mod["main"], data_shape, log_file, graph_opt_sch_file)
  File "", line 163, in tune_graph
  File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/", line 207, in run
  File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/", line 106, in _backward
    states_list, aligned_node_list = DPStage.align_states(
  File "/ssd5/jiangjiajun/tvm/python/tvm/autotvm/graph_tuner/", 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/", line 180, in broadcast_to
    return _broadcast_to(array, shape, subok=subok, readonly=True)
  File "/ssd5/anaconda3/lib/python3.8/site-packages/numpy/lib/", 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~

At the first glance, the error happens at the graph tuner, which is invoked after AutoTVM to optimize e2e performance on x86, so the problem isn’t the tuners you’ve tried. To debug, you can start from printing out input_node_states and aligned_shape in python/tvm/autotvm/graph_tuner/ to check whether their sizes are reasonable. Note that you should be able to comment out the task tuning loop and reuse the tuning logs to reproduce this problem, instead of spending another hours/days.

Also cc @kevinthesun