In spite of this issue having lots and lots of threads, I still can’t figure it out.
I am attempting to push my model to a production service called ubiops, which similar to lambda asks for a .zip archive containing certain requirements. The only objective on ubiops is to run model.predict
and nothing else. I give them a Deployment
class and they import it into their driver and build the project. The issue is that under the current way I am saving and loading my model, the load part needs to have a custom function called get_y_fn
that was used in training, and isn’t even relevant to running model.predict
. I have tried a whole assortment of hacks to get that method instantiated inside the main context, but can’t do it. So now I am looking for ways to do surgery on the model pickle file. So I am looking at state dictionaries, and loading straight with torch. But I want some of the information, such as the transformation spec that is saved with my model, just not the get_y_fn
.
Should I create an empty data loader with the same shape as my training data loader? Can I somehow just remove some but not all parts of the model file?
Please help!
Thanks in advance