Open frobnitzem opened 2 years ago
I'm standing before the same issue. I got the results I wanted (pending error analysis) by loading the model from the same config that I used when training, and calling from_disk
on that.
config = Config().from_disk("config.cfg")
config = registry.resolve(config)
model = config["model"].from_disk("model")
So I get the feeling from_disk
only reads the trained weights of the model, but not the model architecture? I also hope this can be clarified in the documentation.
Yes the .from_disk()
method only reads binary weights. We don't want to invoke code during deserialisation, so you have to set up the model how you expect it to be on the other side. You can use the registry to help with this.
When I tried literally running
I as referenced by the documentation, I got an error:
So, the documentation needs be updated to note what kind of model instance has to be used for reading from disk. Can I use a generic
Model("unknown", lambda x: None)
or do I need a look-alike model to the one I'm reading?