Tensorflow Federated Tutorial In Google Colab Giving Errors In The Initialization Code Snippet
Here is the cell that needs to be run before starting the tutorial. #@test {'skip': true} # tensorflow_federated_nightly also bring in tf_nightly, which # can causes a duplicate t
Solution 1:
Even though the console says there was an error, the pip packages should have been installed correctly.
This happens because the notebooks use tensorflow-federated-nightly
, which depends on an installs tf-nightly
overwriting the base tensorflow
install. However pip
still thinks the TFF dependencies will conflict with the now overwritten TensorFlow core package.
Adding tensorflow
to the !pip uninstall
list may make this error go away, but the functionality of the notebook won't change.
Solution 2:
You can import tensorflow federated like the following. It solved my error. I tried to follow Federated Learning for Image Classification and while I was trying to import tensorflow_federated it was always giving me error.
from tensorflow_federated import python as tff
Post a Comment for "Tensorflow Federated Tutorial In Google Colab Giving Errors In The Initialization Code Snippet"