problem with set_weights

Hi all,
I’m new with Flower, and I’m using an autoencoder with TensorFlow for federated learning, but I’m encountering this error: ValueError: You called s) oset_weights(weightn layer 'sequential_1' with a weight list of length 12, but the layer was expecting 0 weights.

I initialize the global model and compile it without fit so it has 0 weights
can you suggest me a solution?
Thanks

2 Likes

Hi @sinda1980 , let me point you to the quickstart-tensorflow example. There, the ServerApp initializes the model (and therefore fit() has never been called).

Please take a look and let us know if this helps!

1 Like

Hi @sinda1980, did Javier’s comment help you solve the issue you were facing?

Hi @williamlm, unfortunately no
The only solution i found is that to apply fit method with a small number of epoch ti initialize the model’s weights

what autoencoder are you using? Could you show me how you run the code? @sinda1980