bnsreenu / python_for_microscopists

https://www.youtube.com/channel/UC34rW-HtPJulxr5wp2Xa04w?sub_confirmation=1
MIT License
3.78k stars 2.35k forks source link

from keras.utils import to_categorical #41

Open zafor44 opened 2 years ago

zafor44 commented 2 years ago

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)

NileshArnaiya commented 1 year ago

Use this - from tensorflow.keras.utils import to_categorical