In [5]: import os
import numpy as np
import cv2
from time import time
from tensorflow.keras import utils
from tensorflow.keras import datasets, layers, models, optimizers
from keras.models import *
from keras.layers import *
import tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
from keras.preprocessing.image import ImageDataGenerator
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report, confusion_matrix, ConfusionMatrixDisplay
import pandas as pd
from IPython.display import display
import matplotlib.pyplot as plt
2024-04-16 04:24:02.150889: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimize
d to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compil
er flags.
/opt/anaconda3/lib/python3.9/site-packages/scipy/__init__.py:155: UserWarning: A NumPy version >=1.18.5 and <1.25.0
is required for this version of SciPy (detected version 1.26.4
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
ImportError
Traceback (most recent call last)
/var/folders/ny/mxm7l6_10fnbzttzpttymkw00000gn/T/ipykernel_14631/2673801076.py in <module>
9 import tensorflow as tf
10 from sklearn.preprocessing import OneHotEncoder
11 from keras.preprocessing.image import ImageDataGenerator
12 from sklearn.model_selection import train_test_split
13 from sklearn.metrics import classification_report, confusion_matrix, ConfusionMatrixDisplay
ImportError: cannot import name 'ImageDataGenerator' from 'keras.preprocessing.image' (/opt/anaconda3/lib/python3.
9/site-packages/keras/preprocessing/image/__init__.py)