Error:tvm build error when the pb model has parameter training

I save a pb model.the model define as below:

def resnet_18(features, params, is_training, reuse_variables=None, aux_features=None):

features = tf.layers.batch_normalization(features, momentum=params.batchnorm_momentum, training=is_training, name=“conv0_bn”)

I save the pb when predict and can restore the pb from tf and run success.

I compile the pb with tvm is successful,too.

But build error TVMError: Check failed: checked_type_.defined(): internal error: the type checker has not populated the checked_type field for CallNode.

I think is the is_training’s problem.

Any suggestion?Thanks

Have you tried TFParser? https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/frontend/tensorflow_parser.py#L37-L38

I did not use savedmodel mode before. I’ll try later.

I checked TVM tutorial about compile tensorflow,it’s pb with batchnorm and it’s work in TVM.My pb work in tf but fails in TVM.so is there any guide to export pb for tvm?Thanks.

You can also try that API for pb file.

the same error

if use these method below,it will TVMError: if is not supported

    with relay.build_config(opt_level=3):
        executor = relay.build_module.create_executor('graph', mod, ctx, target)
    print("build finish")
    tvm_out = executor.evaluate()(tvm.nd.array(data.astype('float32')), **params)

Now ,I manually set is_training=false when build the model,like

def resnet_18(features, params, is_training, reuse_variables=None, aux_features=None): is_training=false …

features = tf.layers.batch_normalization(features, momentum=params.batchnorm_momentum, training=is_training, name=“conv0_bn”)

Then,it will be Ok.But this way is not elegant. :stuck_out_tongue: I want to know is there any other method.Because resnet is so common model,Thanks for your work again