Closed JerryFishY closed 3 months ago
That's weird, I replicated the commands and I obtained:
narger@MacBook-Pro-di-Lorenzo build % ./LowMemoryFHEResNet20 generate_keys 1
Ciphertexts depth: 23, available multiplications: 7
You are using log(Q+P) = 1756
Context built, generating keys...
Generated.
Now serializing keys ...
EvalMult keys have been serialized
Crypto Context have been serialized
Public Key has been serialized
Secret Key has been serialized
Rotation keys "rotations-layer1.bin" have been serialized
Rotation keys "rotations-layer2-downsample.bin" have been serialized
Rotation keys "rotations-layer2.bin" have been serialized
Rotation keys "rotations-layer3-downsample.bin" have been serialized
Rotation keys "rotations-layer3.bin" have been serialized
Rotation keys "rotations-finallayer.bin" have been serialized
Context created correctly.
narger@MacBook-Pro-di-Lorenzo build % ./LowMemoryFHEResNet20 load_keys 1 input "inputs/vale.jpg"
Encrypted ResNet20 classification started.
I am going to encrypt and classify ../inputs/vale.jpg.
Decrypting the output...
Output: [ -0.384, -2.183, -2.889, 2.112, -1.509, 9.036, -1.412, -1.074, -0.251, -1.438 ]
The input image is classified as Dog
The index of max element is 5
Your error says that it is trying to reseale a ciphertext at the last level, I guess it is happening before the bootstrapping. I wonder if OpenFHE's last version has something different in that procedure.
Could you please:
keys_exp1
folderFHEController.cpp
to uint32_t levelsUsedBeforeBootstrap = get_relu_depth(relu_deg) + 4;
?
Thank you
Sorry for late response, it could now successfully run after changing the levels and ring size. Thanks!
I tried FHEController.cpp to uint32_tlevelsUsedBeforeBootstrap = get_relu_depth(relu_deg) + 4; but error
How to set parameters?
t'hthanks
The problem is that using by uint32_tlevelsUsedBeforeBootstrap = get_relu_depth(relu_deg) + 4
, the modulus becomes too large and the security goes below $\lambda = 128$ bits.
I don't know why with newer versions the errorDropLastElement: Removing last element of DCRTPoly renders it invalid.
pops up, so I suggest you different alternatives:
parameters.SetSecurityLevel(SecurityLevel::HEStd_NotSet);
), ORgenerate_context
from 16 to 17 (notice that the performance will degrade, and the required memory doubled).
I encoutered an error during runtime.
The version of OpenFHE I am using is v1.1.3,
the command I execute is:
The first command runs successfully while the second one will encouter an exception: