python_for_microscopists icon indicating copy to clipboard operation
python_for_microscopists copied to clipboard

from keras.utils import to_categorical

Open zafor44 opened this issue 2 years ago • 1 comments

ImportError Traceback (most recent call last) ~\R\WIN-LI~1\3.6/ipykernel_8504/614165243.py in 5 from sklearn.preprocessing import MinMaxScaler 6 scaler = MinMaxScaler() ----> 7 from keras.utils import to_categorical 8 9 #Use this to preprocess input for transfer learning

ImportError: cannot import name 'to_categorical' from 'keras.utils' (C:\Users\USER\anaconda3\lib\site-packages\keras\utils_init_.py)

zafor44 avatar Jul 14 '22 15:07 zafor44

Use this - from tensorflow.keras.utils import to_categorical

NileshArnaiya avatar Oct 31 '22 08:10 NileshArnaiya