facebookarchive / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Apache License 2.0
8.42k stars 1.94k forks source link

How to save RNN model into .pb file #2526

Open ycAlex11 opened 6 years ago

ycAlex11 commented 6 years ago

hi, I went through the char_rnn on GitHub. I wish to save the model into .pb file. has anyone tried that before? Or anyone can give me some tips to do that I have tried save model like this: with open(PREDICT_NET, 'wb') as f: f.write(model.model.net._net.SerializeToString()) with open(INIT_NET, 'wb') as f: f.write(init_net.SerializeToString()) but I could not load the pb file back, it gives error on init_net.pb: UnicodeDecodeError: 'ascii' codec can't decode byte 0xac in position 11: ordinal not in range(128):

beichen2012 commented 6 years ago

Me too....