peterjc123
peterjc123
It was caused by the pattern. `a = torch.cat((b, torch.zeros(...)), dim=...)`. We may write a optimizer pass for that.
> Is there a way to stop these values being created? I can't immediately see where they come from to know if I can adjust the model or similar, but...
> Thank you for the tips! That's got me a bit further, although now I'm getting: > `RuntimeError: createStatus == pytorch_qnnp_status_success INTERNAL ASSERT FAILED at "../aten/src/ATen/native/quantized/cpu/BinaryOps.cpp":203, please report a bug...
@BmanClark I guess you may print out the input/output scales of the add operations to find out something weird. You can do that on a model after `quantizer.convert`.
@Plagman Rebased.
等下,这个需要`tf.lite.OpsSet.SELECT_TF_OPS`的吧,我们暂时还不想碰这些东西
话说你可以用contrib里面的tflite2tf(生成tf.function)再结合你这段代码来暂时满足这个需求
> > 等下,这个需要`tf.lite.OpsSet.SELECT_TF_OPS`的吧,我们暂时还不想碰这些东西 > > 啊,不需要tf.lite.OpsSet.SELECT_TF_OPS, 这只是网页的示例,我只需要生成多个graph的需求满足就行了 那我这边先前期研究一下,说实话我更偏向于添加把多个graph给merge起来的功能,这样至少core代码不用动
> > tflite2tf(生成tf.function) > > 我先试一下这个tflite2tf,不过感觉支持的op不是很多,可能不太能满足需求。 不够可以添加的,这个难度不高,你懂的
> > > > 等下,这个需要`tf.lite.OpsSet.SELECT_TF_OPS`的吧,我们暂时还不想碰这些东西 > > > > > > > > > 啊,不需要tf.lite.OpsSet.SELECT_TF_OPS, 这只是网页的示例,我只需要生成多个graph的需求满足就行了 > > > > > > 那我这边先前期研究一下,说实话我更偏向于添加把多个graph给merge起来的功能,这样至少core代码不用动 > > 嗯嗯,那非常感谢了! 主要是现在有一些需求是固定一个backone, 后面接不同的功能,如果能分开graph的化会比较灵活 这边试了下,确实是不需要tf的ops就可以完成转换,主要需要支持TFLite Model的SubGraphs以及SignatureDefs,工作量在于需要把不同的SubGraph的信息读出来重新进行组织成新的Model。如前面所说的,会新增一个将多个tflite模型合并在一起的一个函数