openfheorg / openfhe-logreg-training-examples

OpenFHE-Based Examples of Logistic Regression Training using Nesterov Accelerated Gradient Descent
BSD 2-Clause "Simplified" License
20 stars 3 forks source link

Issue with ./lr_nag execution: Empty Input Evaluation Key Map Exception #3

Open HollyLiang974 opened 6 months ago

HollyLiang974 commented 6 months ago

When running the ./lr_nag command , I encountered an error related to an empty input evaluation key map, resulting in a termination of the program. Below is the error message:

bootstrapping enabled
Running in 64-bit mode
Using Bootstrapping
*********************************************
Bootstrapping Crypto Params
        Discrete key used: UNIFORM_TERNARY
        Approx Bootstrap depth: 8
        Levels before bootstrap: 15
        Final Bootstrap Depth:  32
Generating keys
        Mult keys
        EvalSum keys
Feature Analysis:    min     ave    max
        BWTR14: -1 -0.0670072 1
        RECWT: -1 -0.906798 1
        APGAR5R: -1 0.0507812 1
        BFEDN: -1 -0.353516 1
        AB_NICUN: -1 0.474609 1
        APGAR5: -1 -0.815065 1
        CIG_RECN: -1 0.703125 1
        CA_CCHDY: -1 -0.988281 1
        BFEDU: -1 -0.625 1
: 1 1 1 intercept
Feature Analysis:    min     ave    max
        BWTR14: -1.81406 8.75629e-09 2.11671
        RECWT: -0.397435 -1.03125e-08 7.33578
        APGAR5R: -1.69504 -1.62249e-09 1.52858
        BFEDN: -0.699621 5.72989e-09 1.42931
        AB_NICUN: -1.63742 1.29645e-08 0.610703
        APGAR5: -0.650891 2.64614e-09 6.63565
        CIG_RECN: -2.27874 -1.06741e-08 0.43883
        CA_CCHDY: -0.101282 -3.50169e-09 9.87319
        BFEDU: -0.447842 8.56796e-09 2.23288
: 1 1 1 intercept
Feature Analysis:    min     ave    max
: 0 0.5 1MORT
Feature Analysis:    min     ave    max
: 0 0.5 1MORT
        EvalRotate keys
colSize x rowSize = 4096 * 16 = 65536

Bootstrap Iteration: 0 ******************************************************************
terminate called after throwing an instance of 'lbcrypto::OpenFHEException'
  what():  /usr/local/include/openfhe/pke/schemebase/base-scheme.h:l.1214:EvalSumRows(): Input evaluation key map is empty

Steps to Reproduce:

Cloned the repository. Followed the installation instructions. Build this repo Executed the./lr_nag command. Expected Behavior: The ./lr_nagcommand should run without errors and produce the expected output.

Actual Behavior: The program terminates with the mentioned error related to an empty input evaluation key map.

Additional Information:

Operating System: [Ubuntu20.04] Compiler Version: [g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0]

I appreciate any guidance or assistance in resolving this issue. Thank you!

JerryFishY commented 6 months ago

I encoutered the same issue. Did you fix it?

JerryFishY commented 6 months ago

It seems this problem is caused by evalautomorphismkeys. This api will not generate a generated keys, and the keys needed by rows is already generated by evalsum before, so it will not generate it again. I guess switching to a previous version may help.

HollyLiang974 commented 6 months ago

Thank you so much for your help! Following your advice, I rolled back the version of openfhe to v1.1.0, and it solved the issue. Really appreciate your assistance.

ParkerCMcLeod commented 5 months ago

Could we open this issue back up and aim for a fix isntead of a workaround? Ideally, the repo should work with the latest versions of OpenFHE, as it is maintained under openfheorg banner.

WRN1111 commented 4 months ago

Is there any way to do this other than reduce the version.The same thing happened to me.OpenFHE Version: 1.1.4