399 questions
-1
votes
1
answer
108
views
How to install a compatible version of TensorFlow Federated on Google Colab (Python 3.12 + TensorFlow 2.19)?
I am using Google Colab, which comes with:
Python 3.12.11
TensorFlow 2.19.0
When I try:
!pip uninstall -y numpy jax jaxlib
!pip install tensorflow_federated
Pip starts backtracking and tries to ...
0
votes
1
answer
68
views
How can I create an iterative process when i have an TFF error with an inexisting module
When I try to create my iterative process for training my federated models with Tensorflow, I encounter this error
module 'tensorflow_federated.python.learning.algorithms' has no attribute '...
0
votes
0
answers
59
views
Client Selection for Aggregation in TensorFlow Federated (TFF)
I am implementing a client selection mechanism in TensorFlow Federated (TFF), where I need to dynamically choose the top_k clients with the largest dataset sizes before performing model update ...
0
votes
0
answers
14
views
Set_weights for the FedBN algorithm
Attack classification with FedBN algorithm, but normalization is causing difference in weight set.
ValueError: You called `set_weights(weights)` on layer "model_1" with a weight list of ...
0
votes
1
answer
82
views
Problem in Evaluation of TensorFlow Federated Model
I am working on eavesdropper detection on B5G system with Deep Learning. The training dataset contains 1200 CSI images of legitimate and malicious UEs.
I have created a DCNN model (with Keras ...
0
votes
1
answer
169
views
Unable to install tensorflow-federated on M2 Macbook
I am currently facing a really frustrating problem with installing tensorflow federated. I am on M2 Macbook Air, using virtual env, no conda.
I was following this tutorial, and did the following:
...
0
votes
1
answer
106
views
TensorFlow Federated does not use GPU despite being detected
I'm running a TensorFlow Federated (TFF) script and attempting to utilize my GPU for federated learning simulations. While TensorFlow itself detects my GPU and can use it without issues, TFF outputs ...
1
vote
1
answer
130
views
Custom model aggregator TensorFlow Federated
I am experimenting with TensorFlow Federated, simulating a training process with the FedAvg algorithm.
def model_fn():
# Wrap a Keras model for use with TensorFlow Federated
keras_model = ...
0
votes
0
answers
245
views
Error when installing tensorflow_federated package in VS code in Windows 10
I want to install tensorflow_federated package in VS Code in Windows 10 by using 'pip install tensorflow_federated' command. My python version is 3.9.0. But I get this error:
WARNING: Ignoring invalid ...
1
vote
1
answer
304
views
tensorflow federated error module 'tensorflow_federated.python.learning' has no attribute 'build_federated_averaging_process'
I have a ML code
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
...
0
votes
1
answer
51
views
How to save the State(tff.learning.templates.LearningAlgorithmState) and again load it to resume the training process
This is my evaluate function for federated learning:
def evaluate(num_rounds=10):
state = trainer.initialize()
for round in range(num_rounds):
t1 = time.time()
state, metrics = ...
1
vote
1
answer
98
views
Running example code from Tensorflow documentation, pertaining to Tensorflow-Federated, results in AttributeError
I am trying to run the code given by Tensorflow in their official documentation, pertaining to Tensorflow-Federated. The code is as follows:
import tensorflow as tf
import tensorflow_federated as tff
...
-1
votes
1
answer
91
views
Facing error in "Learning Attribute" while working in Tensorflow federated
I'm using NBIOT dataset where i have selected only Provision_PT_737E_Security_Camera dataset of benign, mirai and gagfyt attacks.
The error is:
AttributeError Traceback (most recent call last)...
2
votes
1
answer
74
views
AttributeError: module 'tensorflow_federated.python.core.backends.native' has no attribute 'set_remote_python_execution_context'
I have the following code:
import grpc
ip_address = ['0.0.0.0'] * n_workers #@param {type:"string"}
ports = [80+i for i in range(n_workers)] #@param {type:list["integer"]}
...
0
votes
2
answers
791
views
Tensorflow federated installation giving error
I´m trying to install Tensorflow Federated by running pip install tensorflow-federated in a new Anaconda environment with Python 3.11 in Windows but it gives me this error:
Preparing metadata (setup....
0
votes
1
answer
186
views
Unsuccessfully running tensorflow federated "Hello world" example
I am trying to execute tensorflow federated "Hello world" in jupyter notebook on Visual Studio Code, however the code freezes and doesn't display anything.
Here is the code:
import ...
0
votes
1
answer
755
views
AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'from_keras_model'
Attempting to run federated learning on tff however, encountering the following:
AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'from_keras_model'
Code:
trainer = tff....
0
votes
2
answers
76
views
Obtain F1score, Recall, Confusion Matrix and precison
How can I obtain F1score, Recall, Confusion Matrix and precison in this code.I have used compile and obtained accuracy but i dont know how write the code to obtain these metrics from my model.I would ...
0
votes
1
answer
120
views
Is there an library to get weights of each local model every round of Federated Learning?
In federated learning, I want to get weights of each local model every round, then I will cluster local clients based on their weights, but I can just use training_process.get_model_weights(...
0
votes
0
answers
44
views
Extracting a Federated Reconstruction Model and its Weights
So I'm creating a recommendation system using this Federated Reconstruction tutorial on Tensorflow Federated. I want to use and extract the model and the modelweights but I run into some problems. I ...
1
vote
0
answers
224
views
Tensorflow Federated - can't install
i try to install Tensorflow federated but it won't install
by using pip install --upgrade tensorflow-federated in Command Prompt it start to download version 0.48.0
but it says its trying to find a ...
0
votes
1
answer
230
views
Tensorflow federated increase default_serialization_limit_bytes
I'm doing federated learning with tensorflow federated
for round_num in range(5):
state, metrics = trainer.next(state, federated_train_data)
print('Round {r}, Metrics: {m}'.format(r=round_num, ...
0
votes
0
answers
227
views
Getting error to install tensorflow federated on Colab like IndexError
I am trying to install Tensorflow Federated on Google Colab but am getting error. Surprisingly, if I open new notebook, I can install Tensorflow Federated. Can anyone please help me?
However I used !...
0
votes
1
answer
46
views
Couldn't get any new function for "module 'tensorflow_federated.python.learning' has no attribute 'assign_weights_to_keras_model'"
Can anybody help me to replace this function? I am getting error for these code:
tff.learning.assign_weights_to_keras_model(eval_model, state.model)
0
votes
1
answer
248
views
Unable to install tensorflow_federated in venv
Trying to install tensorflow_federated in venv. But it always gives an error
stating
subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> ...
1
vote
1
answer
788
views
How do I solve the error which I get during training the clients in flower framework for federated learning?
I am trying to implement Federated Learning using Flower framework in python. I get the following error when I start the process.Snapshot of the error
Here is what I tried,
NUM_CLIENTS = 10
#function ...
0
votes
1
answer
155
views
Federated learning with Differential Privacy - Bad test performance
I've been playing for some time with FL + DP for my thesis.
I am using TFF in case someone is wondering.
I load my data as:
train_data = tff.simulation.datasets.ClientData.from_clients_and_fn(
...
0
votes
2
answers
915
views
Error when I am installing TensorFlow Federated Learning. (error: module 'tensorflow' has no attribute 'contrib')
I am trying to install tensorflow federated using command: pip install tensorflow_federated
The installation completes successfuly, but when I am import the package using command
import ...
0
votes
1
answer
149
views
How to use tensorflow_federated in Google Colab?
I tried everything, even the below commands, but nothing is working!
!pip install tensorflow==1.14
!pip install tensorflow-federated==0.4.0
# The latest version of tensorflow-federated is not working ...
0
votes
1
answer
78
views
Saving a tensorflow federated model
I have a tensorflow federated model as seen below:
state = iterative_process.initialize()
where state is the state of the server encapsulating the model.
Printing it we have:
ServerState(model=...
0
votes
1
answer
167
views
compatibility issues for Tensorflow federated in Google colab
TypeError Traceback (most recent call last)
in
5 import numpy as np
6 import tensorflow as tf
----> 7 import tensorflow_federated as tff
14 frames
/usr/lib/python3....
0
votes
0
answers
53
views
Transferring models between two PCs via PostgresSQL database
I have two PCs that want to share tensorflow models "hdf5 format" in a federated learning manner via a PostgresSQL database.
The models will be trained locally on both machines, and then ...
0
votes
0
answers
57
views
How to resolve "module has no attribute 'entropy_decode_index' error in ubuntu for TFF?
I got "module '0b1a516c7ccf3157373118bcf0f434168745c8a4' has no attribute 'entropy_decode_index' error after a clean intall of tensorflow federated (TFF) on Ubuntu 22.04. System: AMD 6900HS, ...
2
votes
1
answer
506
views
TypeError when importing tensorflow_federated
I've been trying to import TensorFlow_federated but have stumbled across an error. After extensively searching the Internet I am yet to find anyone who has encountered the same:
import collections
...
0
votes
0
answers
150
views
Cannot install and import tensorflow_federated in colab
I want to try a simple federated learning example in python. For it, I need to import tensorflow_federated package.
import tensorflow_federated as tff
Here is the stack trace
TypeError ...
0
votes
1
answer
65
views
Why is there only limited usage of thread pools in TensorFlow-Federated?
TFF's threading libraries start a new thread from ThreadRun by default, and the only usage (as of TFF 0.42.0) of the optional ThreadPool parameter is in the implementation of a single executor. Why is ...
1
vote
0
answers
75
views
Training tff metrics on federated training data of clients
I am following this tutorial.
Here I perform training on federated train data:
for round in range(15):
server_state = federated_algorithm.next(server_state, federated_train_data)
and then ...
1
vote
1
answer
1k
views
import tensorflow_federated as tff error in google colab
Hello i'm working on google colab and i have an issue with importing tensorflow_federated as tff it was working fine earlier and i don't know what is the problem now.
here is my code:
I installed all ...
1
vote
0
answers
181
views
How to download the Google Landmark v2 dataset using TensorFlow Federated
I'm attempting to download and use the Google Landmark v2 dataset using TensoFlow Federated with the following code:
train, test = tff.simulation.datasets.gldv2.load_data(gld23k=True)
At some point ...
0
votes
1
answer
63
views
Tensorflow Federated: given a model train it with 2 different datsets and calcaulate euclidian distance between these models
I have a next word prediction model based on federated learning with tensorflow model. My server need to calculate the distance between the model weigtht I receive in each round. Do you have any idea ...
0
votes
2
answers
3k
views
AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'algorithms'
I am trying to run the code given by Tensorflow in their official documentation, pertaining to Tensorflow-Federated.
The code is as follows:
import tensorflow as tf
import tensorflow_federated as tff
...
0
votes
1
answer
164
views
AttributeError: module 'tensorflow_federated' has no attribute 'templates'
federated_algorithm = tff.templates.IterativeProcess(
initialize_fn = initialize_fn, next_fn = next_fn)
TF=2.1.0
Tff=0.13.0
they are showing attribute error.
-2
votes
1
answer
271
views
How to use tensorflow federated library in google colab?
I am trying to use the tensorflow_federated library in google colab but cannot figure out how to do this. I have searched a lot on the internet for the same, but everywhere it's given, you don't need ...
0
votes
1
answer
91
views
How to get shapes of all the layers in a model?
Consider the following model
def create_model():
x_1=tf.Variable(24)
bias_initializer = tf.keras.initializers.HeNormal()
model = Sequential()
model.add(Conv2D(64, (5, 5), input_shape=(28,28,1)...
0
votes
0
answers
161
views
Replacing of weights with set_weights or any other method
I am using tensorflow federated with following imports.
import tensorflow as tf
import tensorflow_federated as tff
import collections
import os
import random
import math
import time
import numpy as np
...
0
votes
0
answers
349
views
Getting error even after enabling eager execution
I am working on tensorflow federated.
I have the following imports
!pip install --quiet tensorflow-federated==0.20.0 # The latest version of tensorflow-federated is not working with the colab python ...
0
votes
2
answers
420
views
Does tensorflow-federated support decision tree training model?
Going over the tutorials for TFF (tensorflow-federated), it seems that performing federated averaging and gradient descent iterations using TFF is well understood and can accomplished easily. However, ...
2
votes
0
answers
335
views
'Tensor' object has no attribute 'numpy'
I am working on tensorflow federated (tff). The problem arises when I call the iterative process and pass on the instance of the model created.
I have declared a keras model which is used at both the ...
1
vote
1
answer
290
views
Noise addition to weights using Opacus in a Federated Learning setting
I am planning to use Opacus to implement differential privacy in my federated learning model but I have a very basic doubt that I would love to have cleared before that.
So as far as my understanding ...
1
vote
1
answer
214
views
TypeError: Expected keras.losses.Loss, found function
I want to build a TFF model for speech recognition systems. For this, I use the CNN-GRU model architecture with a CTC loss function. but I got error when I wanted to build_federated_averaging_process ...