解决ImportError: cannot import name ‘np_utils‘ from ‘tensorflow.keras.utils‘

解决ImportError: cannot import name ‘np_utils’ from ‘tensorflow.keras.utils’

The following error occurred when from tensorflow.keras.utils import np_utils was used when constructing the corpus vocabulary

Insert picture description here

Solution


Change the statement of the package guide to: from tensorflow.python.keras.utils import np_utils
Insert picture description here

Error resolved! !

Insert picture description here

Guess you like

Origin blog.csdn.net/zjlwdqca/article/details/110928860