cannot import name 'set_policy' from 'keras.mixed_precision.policy'

Viewed 421

when i try to do "from tensorflow.keras import intitializers" i get "cannot import name 'set_policy' from 'keras.mixed_precision.policy'" this error. Any solutions?

2 Answers

go to the error directory and change the import from

from tensorflow.python.keras.mixed_precision.policy import set_policy

to

from tensorflow.python.keras.mixed_precision.policy import set_global_policy

or

from tensorflow.python.keras.mixed_precision.policy import set_policy as set_global_policy
Related