Closed Le0v1n closed 2 years ago
问题1: avg_pool3d 目前不支持,新版本支持 问题2: 是的,目前不支持conv3d 问题3:你是问要怎么支持conv3d吗?
我想将我的3D-CNN分类模型
运行在手机上,所以如何将含有Conv3d
的PyTorch模型转换为.tflite
模型呢?
需要converter这边支持conv3d的转换,但是麻烦的是这个会牵扯到tflite schema的升级,因为2.4和2.3完全不兼容
需要converter这边支持conv3d的转换,但是麻烦的是这个会牵扯到tflite schema的升级,因为2.4和2.3完全不兼容
意思是这个问题占时无解,只能等待后续支持Conv3d
了,是吗?
请问还有其他办法来实现同样的功能吗?
除非你kernel的维度有1,可以降成2D来跑,否则好像是不行,只能等升级了
除非你kernel的维度有1,可以降成2D来跑,否则好像是不行,只能等升级了
嗯嗯,等升级吧 :joy:
非常感谢你的回答!
@Le0v1n 抱歉,纠正一下,看这里https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/pooling3d.cc 3d pooling在新版本TFLite中是支持的
收到
TFLite schema升级相关PR: https://github.com/alibaba/TinyNeuralNetwork/pull/57
@Le0v1n 帮忙试下模型现在可以转换了不?
@Le0v1n 帮忙试下模型现在可以转换了不?
Some ops are not supported by the native TFLite runtime, you can enable TF kernels fallback using TF Select. See instructions: https://www.tensorflow.org/lite/guide/ops_select
TF Select ops: AvgPool3D
Details:
tf.AvgPool3D(tensor<1x1x6x6x1024xf32>) -> (tensor<1x1x1x1x1024xf32>) : {data_format = "NDHWC", device = "", ksize = [1, 1, 6, 6, 1], padding = "VALID", strides = [1, 1, 6, 6, 1]}
nn.AvgPool3d
仍然不支持,但3D-CNN可以了。
非常感谢大佬!大佬辛苦了!
非常棒的Repo,但我想使用
convert.py
将PyTorch训练好的3DCNN分类模型转换为.tflite
模型,发生了错误:问题1:
x = F.avg_pool3d(x, x.data.size()[-3:])
不支持问题2:我将
Temporal
通道Squeeze掉了,但还是发生了错误:Only Conv[Transpose]1d/2d is supported
请问是因为不支持Conv3d
吗?问题3:如果支持
Conv3d
,我该怎么做?期待您的回答!