Model move from python to ios missing lapack

Ok, I have a model that I am trying to move to ios.

I figured out most of the jit export commands. After running the model on mobile it is saying missing the lapack. I read a few others forums on here that you have to build with la pack. My question is do I build the local pytorch doing the training and export or do I rebuild the libtorch for ios?

I think I need to rebuild torch, load up my models and jit save them there after. Is that the correct flow?

I think you need to rebuild libtorch for ios with LAPACK. @xta0 if he has more input.

Ok thanks. I was following you other tutorial from this thread on mobile: LAPACK library not found in compilation (Pytorch Mobile, Android, Java) - #10 by Paran0
you noted the changed on torch for the libtorch solution I think?
I’ll try followinrg the iOS | PyTorch

This turned moving a model from a few hour task to days to weeks, would love this included :slight_smile:

Yeah I had forgotten about what I wrote on that thread :). But it sounds about right. Unfortunately it may require some manual tweaking and building pt from source. I think we will try to include lapack in pt mobile builds for future. Do you mind filing an issue and tagging me on it? Thanks!

Ok, sent a github issue:

Tried to put the pytroch model exported on the device and it says the model version is 7 and software is 2 - 5 supported. Is that cause I need to rebuild and use libtorch now?

Yeah so you probably exported model using later versions of libtorch but the libtorch/runtime on the device is older one. So it is likely backwards compatibility (newer models cannot run on older runtime) issue. You will have to update the runtime on device. Alternatively we have backporting supported but I dont remember since when. Which version of libtorch you are using? Or are you building from source?

@Martin_Yuan for more info on backporting.

Using the latest ios cocoapod but I had to rebuild pytorch for the la pack so I assume the libtorch needs to be rebuilt right?

I think so. Let us know if rebuilding from source does not work for you.