# Input image:0 has unknown dimension shapes during compilation

**URL:** <https://discuss.tvm.apache.org/t/input-image-0-has-unknown-dimension-shapes-during-compilation/10971>\
**Category:** Troubleshooting\
**Created:** [September 7, 2021, 12:12pm UTC](https://discuss.tvm.apache.org/t/input-image-0-has-unknown-dimension-shapes-during-compilation/10971 "2021-09-07T12:12:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harishch4](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/harishch4/32/2230_2.png) [@harishch4](https://discuss.tvm.apache.org/u/harishch4)\
**Post date:** [September 7, 2021, 12:12pm UTC](https://discuss.tvm.apache.org/t/input-image-0-has-unknown-dimension-shapes-during-compilation/10971/1 "2021-09-07T12:12:37Z")

</div>

I’ve downloaded the MobileNet model from [here](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) and while trying to compile it for llvm target, I’m getting the below error.

`tvmc compile --target llvm mobilenetv2-7.onnx`

**Outupt:**

` Check failed: (pval != nullptr) is false: Cannot allocate memory symbolic tensor shape [?, 1080, 1920, 3]`

Do I have to save the model after shape inference and then compile?

---

<div class="post-metadata">

**Author:** ![yuchenj](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/yuchenj/32/2659_2.png) [@yuchenj](https://discuss.tvm.apache.org/u/yuchenj)\
**Post date:** [September 7, 2021, 7:43pm UTC](https://discuss.tvm.apache.org/t/input-image-0-has-unknown-dimension-shapes-during-compilation/10971/2 "2021-09-07T19:43:10Z")

</div>

Hi @harishch4, the error suggests that the model has a dynamic batch size, and you will need to use Relay [VM](https://github.com/apache/tvm/blob/main/python/tvm/runtime/vm.py) to compile and execute a model with dynamic shapes. I am not an expert on tvmc, but by looking at its code it seems to only support graph executor.

---

<div class="post-metadata">

**Author:** ![harishch4](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/harishch4/32/2230_2.png) [@harishch4](https://discuss.tvm.apache.org/u/harishch4)\
**Post date:** [September 8, 2021, 4:51am UTC](https://discuss.tvm.apache.org/t/input-image-0-has-unknown-dimension-shapes-during-compilation/10971/3 "2021-09-08T04:51:05Z")

</div>

My bad, there is an option to specify input shapes in ttvm command.

> –input-shapes INPUT\_SHAPES specify non-generic shapes for model to run, format is “input\_name:[dim1,dim2,…,dimn] input\_name2:[dim1,dim2]”.
