singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [singa] dcslin edited a comment on issue #691: Add save and load method for Module class
Date Sat, 16 May 2020 12:29:09 GMT

dcslin edited a comment on issue #691:

   Quoted from @joddiy , `m=MyModel(path) # check the file is a model or just states`, this
case, user know `MyModel` class, so just loading states right?
   From the perspective of a new onnx user, please let me know if this part is not correct.
   `singa_rep`: model like `singa.Module`
   ``: save/load model w/o states
   `singa.Module.save_states()/load_states()`: save/load model states only
   ### Use case 1, load model from onnx file
   class MySONNXModel(SONNXModel):
       pass # so we know the structure of model already?
   # load from onnx model
   m1=MySONNXModel(onnx_model) # so we know the structure of model already?
   m1.compile([placeholder_x], ...)
   for _ in data:
   ### use case 2: save states and model
   # save
   ### use case 3 load model and states from disk
   # Later reuse the model
   m2.compile([placeholder_x], use_graph=True)
   ### use case 4 load states only
   # model is known
   class MyModel(Module):
   m3=MyModel(states_path='./saved_models/my_checkpoint_1') # could only be states, right?
   # m3=MyModel('./saved_models/my_model_1') # could not be saved_model right?
   To be frank, I am a bit overwhelmed by all the discussions not just in this issue, is it
possible to consolidate the new API into a specification including example in singa-doc? Which
is useful for new users? btw, is API in [onnx-doc](
gonna change?

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message