from tensorflow import keras
import numpy as np
import pickle
import cv2, os
from glob import glob
from keras import optimizers
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
from keras.utils import np_utils
from keras.callbacks import ModelCheckpoint
from keras import backend as K
我正在尝试导入以下模块和包。但我面对这个错误,说:
Traceback (most recent call last):
File "c:\Users\KUNDANA\Desktop\rama\DSA- Python\trails.py", line 13, in <module>
from keras.utils import np_utils
ImportError: cannot import name 'np_utils' from 'keras.utils' (C:\Users\KUNDANA\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\utils\__init__.py)
1条答案
按热度按时间kokeuurv1#
看起来你想提前对数据的目标进行一次热编码。请使用代码:
而不是这一行:
问题就解决了。