I have my PyTorch model and I need to make an android app using it for a demo. I was thinking of somehow converting it into a tensorflow model by manually copying weights using a dictionary but is there any easier way? Thanks in advance

3 Likes

Yeah, you’ll have to use something like TensorFlow or Caffe2. We’re working on ways to improve exporting models, but for now you’ll have to:

- Get the weights via
`model.state_dict()`

- Convert the
`Tensors`

to NumPy arrays - Copy the weights into your TensorFlow or Caffe2 model

2 Likes

I’ve been having lots and lots of trouble trying to convert my model to tensorflow. Does torch-android still have support? I’m unable to build it for some reason.

maybe it would be better to have isolated model on backend of your application since you don’t have ability to run in directly on devices?

Could you give a walk-through example for those steps? Thanks!

@colesbury: Have there been any recent developments on this topic since you posted your last answer (Aug’17)? Or is the process still roughly the same? Thank you so much.