简体   繁体   中英

Loading a pre-trained model in Chainer Deep Learning Framework

I need to load a pre-trained model in Chainer framework , but as I understood, the saved (.npz) file only contains the weights and I have to reconstruct the model then load the weights into it, and there is no way to load the full model in one command like Tensorflow.

Is this true? I so, anyone with Chainer framework experience can provide some guidance? If not, what is the proper way to load a pre-trained model in the mentioned framework?

Yes, only npz files only contain weights. You need to first construct an instance of the model (a subclass of chainer.Chain ), then load weights on it using load_npz . https://docs.chainer.org/en/stable/guides/serializers.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM