title: Converting Pytorch model .pth into onnx model
body: <p>I have one pre-trained model into format of .pth extension. I want to convert that into Tensorflow protobuf. But I am not finding any way to do that. I have seen onnx can convert models from pytorch into onnx and then from onnx to Tensorflow. But with that approach I got following error in the first stage of conversion.</p>
  
  <pre><code>from torch.autograd import Variable
  import torch.onnx
  import torchvision
  import torch 
  
  dummy_input = Variable(torch.randn(1, 3, 256, 256))
  model = torch.load('./my_model.pth')
  torch.onnx.export(model, dummy_input, "moment-in-time.onnx")`
  </code></pre>
  
  <p>It gives error like this.</p>
  
  <pre><code>File "t.py", line 9, in &lt;module&gt;
      torch.onnx.export(model, dummy_input, "moment-in-time.onnx")
    File "/usr/local/lib/python3.5/dist-packages/torch/onnx/__init__.py", line 75, in export
      _export(model, args, f, export_params, verbose, training)
    File "/usr/local/lib/python3.5/dist-packages/torch/onnx/__init__.py", line 108, in _export
      orig_state_dict_keys = model.state_dict().keys()
  AttributeError: 'dict' object has no attribute 'state_dict'
  </code></pre>
  
  <p>What is possible solution ? </p>