Skip to content

Save and load SP,TM is not the same #874

Description

@Qubitza

Hi together,

I think there is a bug in the saving and loading process of the TM.

After saving and loading a TM using the writeToString and loadFromString methods:

loaded_tm = TemporalMemory()
loaded_tm.loadFromString( current_tm.writeToString() )

I recognized that the loaded TM behaves differently (in processing further data) compared to the not saved one.

I checked the binding tests and found that the method testNupicTemporalMemorySavingToString in temporal_memory_test.py is marked with a skip annotation.

However, I only get the mentioned rapidjson assertion when saving a TM before calling tm.reset(). After resetting the TM's prediction, the assertion is not raised.

Unfortunately, the loaded TM seems to be different, as the following call returns False:

str(current_tm) == str(loaded_tm) # => False

Same thing happens with saving the TM to a file:

current_tm.saveToFile('tm.tmp')

loaded_tm = TemporalMemory()
loaded_tm.loadFromFile('tm.tmp')

str(current_tm) == str(loaded_tm) # => False

Can you confirm the issue?
Is there a workaround?

Thank you in advance.

I'm currently on commit 4818064, and thus 4 commits behind the master (which seem not to address this issue). Using Python 3.7.7 64-bit on Windows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions