使用plumber生成SG失败



  • 使用自己的模型,在第一步通过模型固化代码生成了model.pb模型,在第二部生成SG过程中失败,错误信息如下:

    Generating SG from ./tmp/model.pb to ./tmp/model_sg.pb
    2019-01-29 06:54:06 INFO loading TensorFlow model from ./tmp/model.pb ...
    2019-01-29 06:54:06 INFO Initialising with model frozen file ...
    2019-01-29 06:54:07 INFO Successfully loaded the model!
    2019-01-29 06:54:07 INFO Rewriting the input TensorFlow Graph for convenient SG generation ...
    2019-01-29 06:54:07 INFO Rewriting the graph by "ReshapeRewriter" ...
    Traceback (most recent call last):
    File "/usr/local/bin/plumber_cli", line 11, in <module>
    sys.exit(cli())
    File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 722, in call
    return self.main(*args, **kwargs)
    File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
    File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/lib/python3.5/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File "/usr/local/lib/python3.5/dist-packages/plumber_cli.py", line 227, in sg
    input_image_shape=input_image_shape)
    File "/usr/local/lib/python3.5/dist-packages/plumber_cli.py", line 132, in sg_func
    sg = utils.gen_sg(model, input_image_shape=input_image_shape)
    File "plumber/utils.py", line 97, in plumber.utils.gen_sg
    File "plumber/frontend/tf/frontend.py", line 118, in plumber.frontend.tf.frontend.TensorFlowFrontEnd.load
    File "plumber/frontend/tf/frontend.py", line 145, in plumber.frontend.tf.frontend.TensorFlowFrontEnd.rewrite_graph
    File "plumber/frontend/tf/graph_rewriter.py", line 434, in plumber.frontend.tf.graph_rewriter.rewrite_reshape_batch_size
    File "plumber/frontend/tf/graph_rewriter.py", line 185, in plumber.frontend.tf.graph_rewriter._reset_reshape_batch_size
    AssertionError



  • @顾嵩 你好,目前的加速卡架构暂时只支持图像检测的SSD算法,其他模型需要等到编译器升级完毕之后才能支持,非常感谢!



  • @Research 是一个超分辨率的项目,github地址https://github.com/jmiller656/EDSR-Tensorflow?files=1



  • 是使用网上的开源模型做的吗?



  • Hi,目前来看,错误应该发生在输入形状的问题上,请问您的 model.pb 的输入是否是 tf.placeholder 的形式,有没有指定明确的形状呢?如 tf.placeholder(tf.float32, shape=(1, 28, 28, 3), name='x')。如果输入是 Placeholder,或许你可以在使用 sg 命令时使用参数 --input-image-shape 1,28,28,3 指定一下输入形状,1,28,28,3 替换成自己模型的实际输入,看看是否还会报错。如果还会报错,可能需要对 mode.pb 进行分析。