peters-stuff icon indicating copy to clipboard operation
peters-stuff copied to clipboard

How to save and load fp16 pb files

Open gjm441 opened this issue 7 years ago • 1 comments

Thanks for your code, peterneher. I have run the caffe2 code on my machine. I create float16 net. but after save it to pb, and then load blobs, I watch that blobs weight values changes to float32 type. How can I save it in float16 type ?

gjm441 avatar Oct 28 '17 02:10 gjm441

Hi all,

do you know maybe how can I solve the following issue that arise when loading the saved model?

Traceback (most recent call last): File "D:/Yeverino/Python_scripts/peter_example.py", line 140, in load_net(INIT_NET, PREDICT_NET, device_opts=device_opts) File "D:/Yeverino/Python_scripts/peter_example.py", line 122, in load_net init_def.ParseFromString(f.read()) File "C:\Python27\lib\site-packages\google\protobuf\message.py", line 185, in ParseFromString self.MergeFromString(serialized) File "C:\Python27\lib\site-packages\google\protobuf\internal\python_message.py", line 1083, in MergeFromString if self._InternalParse(serialized, 0, length) != length: File "C:\Python27\lib\site-packages\google\protobuf\internal\python_message.py", line 1120, in InternalParse pos = field_decoder(buffer, new_pos, end, self, field_dict) File "C:\Python27\lib\site-packages\google\protobuf\internal\decoder.py", line 610, in DecodeRepeatedField raise _DecodeError('Truncated message.') DecodeError: Truncated message.

I verified that files init_net.pb and predict_net.pb were stored in the specified path.

Thanks in advance.

CarlosYeverino avatar Jul 18 '18 13:07 CarlosYeverino