Skip to content
Permalink
Browse files

Merge pull request #3854 from kyle-sorensen/master

Serialize data in binary format, not ascii
  • Loading branch information...
lscheinkman committed Nov 29, 2018
2 parents bba53ad + 063cd99 commit 101f7c7d0e4b730ecae0aa920d8b44b84c187f68
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/nupic/frameworks/opf/model.py
@@ -351,7 +351,7 @@ def save(self, saveModelDir):
with open(modelPickleFilePath, 'wb') as modelPickleFile:
logger.debug("(%s) Pickling Model instance...", self)

pickle.dump(self, modelPickleFile)
pickle.dump(self, modelPickleFile, protocol=pickle.HIGHEST_PROTOCOL)

logger.debug("(%s) Finished pickling Model instance", self)

@@ -387,7 +387,7 @@ def load(cls, savedModelDir):
# Load the model
modelPickleFilePath = Model._getModelPickleFilePath(savedModelDir)

with open(modelPickleFilePath, 'r') as modelPickleFile:
with open(modelPickleFilePath, 'rb') as modelPickleFile:
logger.debug("Unpickling Model instance...")

model = pickle.load(modelPickleFile)

0 comments on commit 101f7c7

Please sign in to comment.
You can’t perform that action at this time.