Conv2D expects data's shape to be [4294967295,299,299,3], but got [-1,299,299,3]


I found similar issue (TVM TF Converter Bug with Inception_v4 network)
basically, error I am experiencing is same error.

I cloned TVM on Jan 9, 2019. (94cc89dab079fa41cade3830e0bcfa12f9703a87)

What I was trying to do is

Error I got (while calling…)) is as follows:

File “”, line 139, in
graph, lib, params =, shape=shape_dict, target=target, target_host=target_host, dtype=dtype_dict, params=params)
File “/home/eric/dev/tvm/nnvm/python/nnvm/compiler/”, line 270, in build
ishape, _ = graph_util.infer_shape(graph, **shape)
File “/home/eric/dev/tvm/nnvm/python/nnvm/compiler/”, line 31, in infer_shape
graph = graph.apply(“InferShape”)
File “/home/eric/dev/tvm/nnvm/python/nnvm/”, line 234, in apply
check_call(_LIB.NNGraphApplyPasses(self.handle, npass, cpass, ctypes.byref(ghandle)))
File “/home/eric/dev/tvm/nnvm/python/nnvm/”, line 75, in check_call
raise NNVMError(py_str(_LIB.NNGetLastError()))
nnvm._base.NNVMError: Error in operator InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D: [17:55:03] /home/eric/dev/tvm/nnvm/src/top/nn/ Operator conv2d(layout=NHWC, use_bias=False, strides=(2L, 2L), channels=32, dilation=(1L, 1L), padding=[0, 0], kernel_size=(3L, 3L), kernel_layout=HWIO, name=InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D) expects data’s shape to be [4294967295,299,299,3], but got [-1,299,299,3].

Stack trace returned 10 entries:
[bt] (0) /home/eric/dev/tvm/build/[abi:cxx11](unsigned long)+0x1f5) [0x7f14b5114245]
[bt] (1) /home/eric/dev/tvm/build/ [0x7f14b5114ece]
[bt] (2) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/ const&, std::vector<nnvm::TShape, std::allocatornnvm::TShape >, std::vector<nnvm::TShape, std::allocatornnvm::TShape >)+0x16c9) [0x7f14b0e325c9]
[bt] (3) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7f14b0d794ad]
[bt] (4) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7f14b0d7ac1a]
[bt] (5) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7f14b0d7bf0a]
[bt] (6) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)+0x127d) [0x7f14b0d4eebd]
[bt] (7) /home/eric/dev/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7f14b0d2cce0]
[bt] (8) /usr/lib/x86_64-linux-gnu/ [0x7f14bb881dae]
[bt] (9) /usr/lib/x86_64-linux-gnu/ [0x7f14bb88171f]

In the pb file, InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D is the first conv op, of which input shape is [?,299,299,3].

Would you help me how I can run…) successfully?
Thank you in advance!


Hi, the following changes on solved the above issue:

  • changed the name of input : “DecodeJpeg/contents” -> “input”
  • type of input tensor “uint8” -> “float32”
  • modified the output array shape “(1, 1008)” -> “(1, 1001)”

There is nothing wrong with I had to change the code against the new pb file.



Sorry just to clarify, is it a bug of tvm or the pb file itself?


It is not a but but there’s something wrong with my code to handle my pb file.
Since I used different PB file, the name and type of input and the shape of output were different from the one used by So I modified to work with my pb file. :slight_smile: