MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

mmtoir from PyTorch 2 IR missing .json, .npy and .pb file

Open CengizhanYurdakul opened this issue 4 years ago • 0 comments

I'm trying to convert R101 from PyTorch to Tensorflow with script that mentioned below.

Input:
mmtoir -f pytorch -d Pytorch2IR --inputShape 3,112,112 -n R100PyTorch/Corrected.pth

Output:
PyTorch parser has not supported operator [onnx::Unsqueeze]. IR network strucuture may lost info.
IR network structure is saved as [Pytorch2IR.json].
IR network structure is saved as [Pytorch2IR.pb].
IR weights are saved as [Pytorch2IR.npy].

It's true that the weights and structures are saved but their size;

Pytorch2IR.json --> 1.5 kB Pytorch2IR.npy --> 7.3 kB Pytorch2IR.pb --> 188 bytes

The output of .json file as shown in below:

{
  "node": [
    {
      "attr": {
        "_output_shapes": {
          "list": {
            "shape": [
              {
                "dim": [
                  {
                    "size": "-1"
                  },
                  {
                    "size": "112"
                  },
                  {
                    "size": "112"
                  },
                  {
                    "size": "64"
                  }
                ]
              }
            ]
          }
        },
        "dilations": {
          "list": {
            "i": [
              "1",
              "1",
              "1",
              "1"
            ]
          }
        },
        "strides": {
          "list": {
            "i": [
              "1",
              "1",
              "1",
              "1"
            ]
          }
        },
        "use_bias": {
          "b": false
        },
        "pads": {
          "list": {
            "i": [
              "0",
              "1",
              "1",
              "0",
              "0",
              "1",
              "1",
              "0"
            ]
          }
        },
        "kernel_shape": {
          "list": {
            "i": [
              "3",
              "3",
              "3",
              "64"
            ]
          }
        },
        "group": {
          "i": "1"
        }
      },
      "op": "Conv",
      "name": "node926"
    }
  ]
}

Before trying convert from PyTorch2Tensorflow, I have done Mxnet2Tensorflow for R100 and R50. So, I am sure that mmtoir is working on my environment. I think there are some problem on mmtoir for Pytorch conversion. Anyone faced with that problem or solved?

CengizhanYurdakul avatar Mar 07 '22 08:03 CengizhanYurdakul