Converting is not working in onnx::Reshape() which is converted from .view() of pytorch.
I got 0 dim output by When infer the tflite modelTF Lite on android.
That is tflite.getOutputTensor().numDimensions() is 0.
I think converting failed.
I make a sample codes that shows this problem.
Pytorch codes
class ReshapeModel(nn.Module):
def __init__(self):
super(ReshapeModel, self).__init__()
def forward(self, x):
out = x.view(1, -1, 4).contiguous()
return out
dummy_input = torch.randn(1, 56, 56, 2)
Converting is not working in onnx::Reshape() which is converted from .view() of pytorch. I got 0 dim output by When infer the tflite modelTF Lite on android. That is tflite.getOutputTensor().numDimensions() is 0.
I think converting failed.
I make a sample codes that shows this problem.
Pytorch codes
Onnx log
In some cases, reshape is working, and some cases it fails. Fail case: torch.randn(1, 56, 56, 2) -> x.view(1, 56, -1, 4) Fail case: torch.randn(1, 56, 56, 2) -> x.view(1, -1, 4) OK case: torch.randn(1, 56, 2) -> x.view(1, -1) OK case: torch.randn(1, 56, 56, 2) -> x.view(1, -1)
tensorflow 1.15.0 onnx 1.7.0 onnx-tf 1.6.0 tf-1.x branch torch 1.4.0