# Debug\_executor and graph\_executor have different result

**URL:** <https://discuss.tvm.apache.org/t/debug-executor-and-graph-executor-have-different-result/15654>\
**Category:** Troubleshooting\
**Created:** [September 8, 2023, 3:28am UTC](https://discuss.tvm.apache.org/t/debug-executor-and-graph-executor-have-different-result/15654 "2023-09-08T03:28:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KammKang](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kammkang/32/5049_2.png) [@KammKang](https://discuss.tvm.apache.org/u/KammKang)\
**Post date:** [September 8, 2023, 3:28am UTC](https://discuss.tvm.apache.org/t/debug-executor-and-graph-executor-have-different-result/15654/1 "2023-09-08T03:28:06Z")

</div>

## Description：

Hi all, For the same model and input, debug\_executor produced different predicted results from graph\_executor, How strange it is?

What causes this? Thanks for any comments in advance!

## The reproducible script:

```auto
def run(model_path):

    dev = tvm.cpu()
   
    lib = tvm.runtime.load_module(model_path)
    dmod = debugger.debug_executor.create(lib["get_graph_json"](), lib, dev, dump_root="./tvm")
    gmod = graph_executor.create(lib["get_graph_json"](), lib, dev)
    data = np.ones([1,2050]).astype("float32")
    buffer_data = np.ones([94888,]).astype("float32")
    gmod.set_input("inputs",data)
    dmod.set_input("inputs",data)
    gmod.set_input("buffers",buffer_data)
    dmod.set_input("buffers",buffer_data)
    gmod.run()
    dmod.run()
    print("graph out:")
    print(gmod.get_output(0))
    print("debug graph out:")
    print(dmod.get_output(0))

```

## result

 ![image](https://discuss.tvm.apache.org/uploads/default/original/2X/4/42a611c87ffaf0618c04469f8714c91d00b099f6.png)

---

<div class="post-metadata">

**Author:** ![elfswallow](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/e/2acd7d/32.png) [@elfswallow](https://discuss.tvm.apache.org/u/elfswallow)\
**Post date:** [September 12, 2023, 12:55am UTC](https://discuss.tvm.apache.org/t/debug-executor-and-graph-executor-have-different-result/15654/2 "2023-09-12T00:55:05Z")

</div>

DebugExecutor’s “create” loads parameters, while GraphExecutor’s “create” doesn’t. You can try loading the param from lib after create.

---

<div class="post-metadata">

**Author:** ![KammKang](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kammkang/32/5049_2.png) [@KammKang](https://discuss.tvm.apache.org/u/KammKang)\
**Post date:** [September 12, 2023, 2:01am UTC](https://discuss.tvm.apache.org/t/debug-executor-and-graph-executor-have-different-result/15654/3 "2023-09-12T02:01:17Z")

</div>

thx,it work. but can u tell why? why debug executor will load parameters,but graph executor dont need do this ?
