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
path = "/tmp/vlr"
with open(os.path.join(path, "ctx_whole"), "wb") as f:
f.write(ctx.serialize())
print("save whole context done.")
with open(os.path.join(path, "ctx_public"), "wb") as f:
f.write(ctx_copy.serialize())
print("save public context done.")
`
But when I changed the code in the fifth line to :
ctx = ts.context(ts.SCHEME_TYPE.CKKS, 16384, 0, [60, 40, 40, 40, 60])
The serialization of ctx_copy object can not be saved.
The error is:
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
I'm confused. I searched that the error is usually caused by the insufficient of memory.
I expanded the virtual machine's memory but it doesn't work. I wonder why the serialization of ctx object can be saved but the ctx_copy object goes wrong.
I would be appreciate if you could tell me the reason. Thank you!
The text was updated successfully, but these errors were encountered:
I run the code on my Mac. The code runs correctly. But the memory consumption is almost 100%.
And the file size of ctx object is 1.6 M, but the file size of ctx_copy object is 116.8 M.
Why?
The following code I used before works ok :
`
import tenseal as ts
import copy
import os
ctx = ts.context(ts.SCHEME_TYPE.CKKS, 8192, 0, [60, 40, 40, 60])
ctx.global_scale = pow(2, 40)
ctx.generate_galois_keys()
ctx_copy = copy.deepcopy(ctx)
ctx_copy.make_context_public()
path = "/tmp/vlr"
with open(os.path.join(path, "ctx_whole"), "wb") as f:
f.write(ctx.serialize())
print("save whole context done.")
with open(os.path.join(path, "ctx_public"), "wb") as f:
f.write(ctx_copy.serialize())
print("save public context done.")
`
But when I changed the code in the fifth line to :
ctx = ts.context(ts.SCHEME_TYPE.CKKS, 16384, 0, [60, 40, 40, 40, 60])
The serialization of ctx_copy object can not be saved.
The error is:
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
I'm confused. I searched that the error is usually caused by the insufficient of memory.
I expanded the virtual machine's memory but it doesn't work. I wonder why the serialization of ctx object can be saved but the ctx_copy object goes wrong.
I would be appreciate if you could tell me the reason. Thank you!
The text was updated successfully, but these errors were encountered: