Open muwys518 opened 3 months ago
aot.export is used to trace the model to generate the IR we use to compile the model, similarly to how you are generating the model.pth. So you would want to pass the same model like this:
model = mobilenet_v2(weights='DEFAULT')
export_output = aot.export(model, input)
The pth file then can be used as external weights used at runtime. An example of compiling a model to enable external weights. can be found here: https://github.com/nod-ai/SHARK-Turbine/blob/55e8703abb4f5ad73b9b95ef5e9e0db20a84b7b4/models/turbine_models/custom_models/stateless_llama.py#L180
and using at runtime here: https://github.com/nod-ai/SHARK-Turbine/blob/55e8703abb4f5ad73b9b95ef5e9e0db20a84b7b4/models/turbine_models/model_runner.py#L20
I load torch model with
then I load model.pth with
I get the following error