Closed lmaxeniro closed 2 years ago
Thanks for trying IBMFL. Keras is part of TensorFlow from TF version 2.0 or greater. Please use tf
instead of keras
and everything will run as expected. If you want to use standalone keras
, you need to install TF version 1.15. Please let us know if you still face issue after trying tf
.
I did not modify any code, simply run the original code from github. Just to be clear, the install guidance mentioned that TF2.1.0 is supported that is why I install TF2.1.0 -- do you mean for this example it does not support TF2.1.0? -- or do you mean I shall remove Keras from the TF2.1.0 environment?
It does support TF 2.1.0. What I suggested was to use tf
instead of keras
when generating configs as Keras is part of TF now:
python examples/generate_configs.py -n 2 -f iter_avg -m tf -d mnist -p examples/data/mnist/random/
python -m ibmfl.aggregator.aggregator examples/configs/iter_avg/tf/config_agg.yml
python -m ibmfl.party.party examples/configs/iter_avg/tf/config_party0.yml
OR following in detail:
python examples/generate_data.py -n 2 -d mnist -pp 200
python examples/generate_configs.py -n 2 -f iter_avg -m tf -d mnist -p examples/data/mnist/random
python -m ibmfl.aggregator.aggregator examples/configs/iter_avg/tf/config_agg.yml
START
python -m ibmfl.party.party examples/configs/iter_avg/tf/config_party0.yml
START REGISTER
python -m ibmfl.party.party examples/configs/iter_avg/tf/config_party1.yml
START REGISTER
% At aggregator terminal start training TRAIN
Thanks a lot, this indeed works. I would suggest that you put a little more explanation in the guide about this difference (tf vs. keras)
Hello, I am following the guide (https://github.com/IBM/federated-learning-lib/blob/main/quickstart.md) to run the example project: The aggregator server start fine, while when I am trying to start parties, I meet below error: Python = 3.7.9 tensorflow = 2.1.0 keras = 2.2.4
search round it looks the get_default_graph had been removed from tf2.0 afterwards.. so this demo code won't work for TF2.1.0? is there any workaround?