I met some bugs when convert MobileNetV2(tensorflow)to tvm

everytime I executed the code below,

sym, params = nnvm.frontend.from_tensorflow(gd)

I would get this error:

NotImplementedError: Please freeze the graph with add_shapes=True

It was given by line 994 of ~/tvm/nnvm/python/nnvm/frontend/tensorflow.py

Is it the problem of .pb file of tensorflow? How should i freeze the graph?
the function freeze_graph.freeze_graph() does not have the add_shapes attr. Could someone help me?

Tensorflow frontend expect the graph to be frozen with add_shapes=True.

You may refer to below util

Very useful script ! Do you think this conversion can be merged to
nnvm.testing.tf.ProcessGraphDefParam() or other similar utility function?

1 Like

I proposed to embed into frontend and the decision was to keep this outside front end and warn the user.
nnvm.testing.tf may be a better place. Thanks for the suggestion and I will try to enhance it.

thank you ! this problem has been solved with your help. but if it could only inference with CPU? there are some bugs when i change tvm.cpu(0) to tvm.gpu(0). because the TVM has not surpported the DW convolution?

Majority of Tensorflow models are NHWC and the GPU is good with NCHW. I am working on some changes to frontend to enable GPU by converting operators to NCHW.

This is the related discussion for the same.