Best way of saving and retreiving the sampleset data ?
Hi all, I would like to know how to save and retreive the multiple samplesets.
I tried json.dumps and it worked for a while and saved the data in json format. Now it seems klike that this method does not work anymore.
I tried the following code:
with open(f'test.json', 'w') as f:
serializable_data = sample_set.to_serializable()
if isinstance(serializable_data, np.ndarray):
serializable_data = serializable_data.tolist()
elif isinstance(serializable_data, type):
serializable_data = str(serializable_data)
serialized_data = json.dumps(serializable_data)
f.write(serialized_data + '\n')
I got he following error:
TypeError: Object of type type is not JSON serializable
Any help is much appreciated.
Thank you.
Comments
Hello,
Thanks for reaching out.
See the reference to "pickling" in this comment:
https://support.dwavesys.com/hc/en-us/community/posts/360044193133/comments/360011536253
Please feel free to reach out with more questions!
Please sign in to leave a comment.