MPolaris / onnx2tflite

Tool for onnx->keras or onnx->tflite. Hope this tool can help you.
Apache License 2.0
526 stars 42 forks source link

Shape not implemented yet #28

Closed Ontheway361 closed 1 year ago

Ontheway361 commented 1 year ago

PyTorch code: def forward(self, x):

x.shape = [B, T, F]

    B, _, _ = x.shape
    x = x.unsqueeze(1).transpose(2, 3) 
    x = self.layers(x)
    x = torch.mean(x, dim=2, keepdim=True)
    x = x.view((B, self.last_channel, -1))
    x = x.transpose(1, 2)
    return x

when convert onnx model to tflite, builder.py throw a KeyError, maybe we need to implement Shape op.

MPolaris commented 1 year ago

Hi Ontheway361, you can implement it by yourself at first, and welcome PR.