'module 'tensorflow.compat.v2.__internal__.tracking' has no attribute 'no_automatic_dependency_tracking'

module 'tensorflow.compat.v2.internal.tracking' has no attribute 'no_automatic_dependency_tracking'

Installing dependecies

# tensorflow_federated_nightly also bring in tf_nightly, which
# can causes a duplicate tensorboard install, leading to errors.
!pip uninstall --yes tensorboard tb-nightly

!pip install --quiet --upgrade tensorflow-federated
!pip install --quiet --upgrade nest-asyncio
!pip install --quiet --upgrade tb-nightly  # or tensorboard, but not both

import nest_asyncio
nest_asyncio.apply()

import tensorflow as tf
import tensorflow_federated as tff 

These works fine but errors appear in..

import keras.preprocessing.image.ImageDataGenerator

It was working fluently but after runtime get restarted.



Solution 1:[1]

Which TensorFlow version are you using?
The correct way to import ImageDataGenerator api is:

from tensorflow.keras.preprocessing.image import ImageDataGenerator 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TFer2