chenxin061 / pdarts

Codes for our paper "Progressive Differentiable Architecture Search:Bridging the Depth Gap between Search and Evaluation"
Other
360 stars 83 forks source link

How can i import the found network architecture ? #17

Open cristyioan2000 opened 5 years ago

cristyioan2000 commented 5 years ago

Hello,

I want to load the found architecture in a different script, is there a way to load the architecture structure(class) and the .weight file externally, just by importing using torch.load() ?

Thanks

chenxin061 commented 5 years ago

Sorry for the late reply. If you want to load the architecture, just copy and name the Genotype generated at the end of a search process to genotypes.py. When retraining, use --arch your_arch_name to call the architecture. You can use torch.load() to load the previous weights but I do not suggest to re-use the learned weights by loading the .weight file because it is usually useless in the retraining scenario.

cristyioan2000 commented 5 years ago

I was thinking on saving as a checkpoint the whole class of the network and load it after, like a way to export the whole architecture externally, outside the script and load it without any dependencies, if you want to build the architecture again you need to use modules from Pdarts, and i want to have it like an handmade architecture using just torch functions. I'm going to try with the checkpoint method and if successful i will close the issue. If you do have other solution on exporting the whole architecture i would like to hear it.

chenxin061 commented 5 years ago

I think you should try torch.set/get_rng_state().