You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
from nupic.frameworks.opf.htm_prediction_model import HTMPredictionModel
def test_mutliple_rounds_opf_serialization(self):
for i in range(500):
self.anomaly_model.process_sample(self.source.next())
self.anomaly_model.save(CHECKPOINT_DIR)
restored_model = AnomalyModel.load(CHECKPOINT_DIR)
restored_model.save(CHECKPOINT_DIR)
restored_model = AnomalyModel.load(CHECKPOINT_DIR)
restored_model.save(CHECKPOINT_DIR)
AnomalyModel.load(CHECKPOINT_DIR)
def test_multiple_rounds_serialization(self):
for i in range(500):
sample = self.source.next()
self.anomaly_model.process_sample(sample)
proto1 = HTMPredictionModel.getSchema()
builder = proto1.new_message()
self.anomaly_model.htm_model.write(builder)
data1 = builder.to_bytes_packed()
proto2 = HTMPredictionModel.getSchema()
reader = proto2.from_bytes_packed(data1)
model = HTMPredictionModel.read(reader)
proto3 = HTMPredictionModel.getSchema()
builder = proto3.new_message()
model.write(builder)
data2 = builder.to_bytes_packed()
self.assertEqual(data2, data1)
Both of these tests return the same error. It looks like it's not possible to serialize models more than once?
Edit: It seems this error doesn't show up as long as you compute samples in between serializing. I can't see why we wouldn't do that, maybe this issue doesn't matter.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Serializing multiple times with capnproto results in vague errors
Serializing multiple times with capnproto, KjException: capnp/dynamic.c++:1777: failed
Feb 15, 2018
Just bumping this issue for visualization, it is not important, today I was writing some serialization tests and got this error, took me a while to remember that you cannot serialize/deserialize/serialize without processing samples in between.
It's not an important bug, but some warning somewhere might help other people who run into this and don't just get lucky and stumble into this fact.
Both of these tests return the same error. It looks like it's not possible to serialize models more than once?
Edit: It seems this error doesn't show up as long as you compute samples in between serializing. I can't see why we wouldn't do that, maybe this issue doesn't matter.
HAPPY VALENTINES DAY
The text was updated successfully, but these errors were encountered: