tensorflow-federated

AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'algorithms'

AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'algorithms' Question: 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 def model_fn(): model = tf.keras.models.Sequential([ tf.keras.layers.Dense(10, tf.nn.softmax, input_shape=(784,), kernel_initializer=’zeros’) ]) trainer = tff.learning.algorithms.build_weighted_fed_avg( model_fn, client_optimizer_fn=lambda: tf.keras.optimizers.SGD(0.1)) However, …

Total answers: 2

How to get shapes of all the layers in a model?

How to get shapes of all the layers in a model? Question: 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),activation="relu", name=’conv2d_1′, use_bias=True,bias_initializer=bias_initializer)) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Conv2D(32, (5, 5), activation="relu",name=’conv2d_2′, use_bias=True,bias_initializer=bias_initializer)) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Flatten()) model.add(Dense(120, name=’dense_1′,activation="relu", use_bias=True,bias_initializer=bias_initializer),) model.add(Dense(10, name=’dense_2′, activation="softmax", use_bias=True,bias_initializer=bias_initializer),) Is there any way I can get …

Total answers: 1

What version of Tensorflow federated has the module 'federated_computation'?

What version of Tensorflow federated has the module 'federated_computation'? Question: I am trying to install Tensorflow federated on google collab, but there is a conflict with versions, I either get this error if I install previous versions or similar errors. module tensorflow_federated.python has no attribute federated_computation If I want to install the new version it …

Total answers: 1

Tensorflow Federated | tff.learning.from_keras_model() with a model with DenseFeature layer and multiple inputs

Tensorflow Federated | tff.learning.from_keras_model() with a model with DenseFeature layer and multiple inputs Question: I am trying to federate a keras model which has multiple inputs. These some of these inputs are categorical and some of them are numerical, so I have some DenseFeature layers to embed the values. The problem is that using tff.learning.from_keras_model() …

Total answers: 1