Removing Weight Parameters from the Chainer Trainer

Asked 2 years ago, Updated 2 years ago, 107 views

I think the Chains can normally retrieve the network parameters as model.predictor.conv2.W.data.(model: )

I also wanted to save progress parameters, so I used Trainer's extension.snapshot() which is often used in resume implementations, but the snapshot saved is <class'chain.trainer.trainer'> and I don't know how to take them out.

$zipinfosnapshot_xxxxxx
-rw ----------- 2.0 unx2457680 b-defN17-Jul-27 11:17 updater/optimizer: main/predictor/l1/W/m.npy

I have confirmed that the weight is included in .
I thought I could retrieve the image with trainer.updater.optimizer.xxxx.

I looked into various things, but I didn't understand, so I asked you a question.
I would appreciate it if you could give me a hint.Thank you for your cooperation.

python chainer

2022-09-30 21:26

1 Answers

If there is data in main/predictor/l1/W/m.npy, the data can be seen as text data in numpy.savetext, but is it the answer?
Or save the model in serializers.save_npz while looping in for statements without using trainer.The model is a compressed file, so if you extract it, you will see the .npy file inside.


2022-09-30 21:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.