Nguyen Duong Tung
Nguyen Duong Tung

Reputation: 11

cannot import tensorflow_federated as tff

When I try to import tensorflow_federated I got this error, anyone has the idea why?

    ImportError                               Traceback (most recent call last)
<ipython-input-6-a23308ec3f7c> in <module>()
      3 import numpy as np
      4 import tensorflow as tf
----> 5 import tensorflow_federated as tff
      6 
      7 np.random.seed(0)

17 frames
/usr/local/lib/python3.7/dist-packages/keras/api/_v1/keras/mixed_precision/experimental/__init__.py in <module>()
      6 import sys as _sys
      7 
----> 8 from keras.mixed_precision.loss_scale_optimizer import LossScaleOptimizerV1 as LossScaleOptimizer
      9 from tensorflow.python.util import module_wrapper as _module_wrapper
     10 

ImportError: cannot import name 'LossScaleOptimizerV1' from 'keras.mixed_precision.loss_scale_optimizer' (/usr/local/lib/python3.7/dist-packages/keras/mixed_precision/loss_scale_optimizer.py)

Upvotes: 0

Views: 332

Answers (1)

Nguyen Duong Tung
Nguyen Duong Tung

Reputation: 11

Found the solution, I did this on Google Colab. I just uninstall keras version that was already installed by Colab and reinstall the latest version.

Upvotes: 1

Related Questions