flower icon indicating copy to clipboard operation
flower copied to clipboard

Cannot Save model progress in server (AttributeError: module 'flwr.common' has no attribute 'Weights')

Open dariodematties opened this issue 3 years ago • 0 comments

What is your question?

I want to implement an autoencoder and do checkpointing

I created an env in python

python3 -m venv ~/python_envs/flower then I activated it

source ~/python_envs/flower/bin/activate Install the last version of flower from the repo

pip install git+https://github.com/adap/flower

This is the setup inside the env

(flower) dario@dario:~/MEGA/NAISE/Federated_Learning/a_simple_autoencoder$ python
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flwr
>>> flwr.__version__
'1.1.0'
>>> 

I used this example from your dovumentation

And this is the error

(flower) dario@dario:~/MEGA/NAISE/Federated_Learning/a_simple_autoencoder$ python server.py 
Traceback (most recent call last):
  File "server.py", line 19, in <module>
    class SaveModelStrategy(fl.server.strategy.FedAvg):
  File "server.py", line 25, in SaveModelStrategy
    ) -> Optional[fl.common.Weights]:
AttributeError: module 'flwr.common' has no attribute 'Weights'
(flower) dario@dario:~/MEGA/NAISE/Federated_Learning/a_simple_autoencoder$ 

Codes for server and client attached!

Any suggestion/help?

Thanks!!! a_simple_autoencoder.zip

dariodematties avatar Aug 13 '22 19:08 dariodematties