当我训练我的自动驾驶汽车模型时,它在第一个时期给了我错误。尽管当我减少它时batch_size它工作正常。但这并没有给我我想要的准确性。
我正在 Google Collab 中训练我的模型。
张量流版本 2.3.1
错误:

WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 20000 batches). You may need to use the repeat() function when building your dataset.
Run Code Online (Sandbox Code Playgroud)
我的代码:
def modified_model():
model = Sequential()
model.add(Conv2D(60, (5, 5), input_shape=(32, 32, 1), activation='relu'))
model.add(Conv2D(60, (5, 5), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(30, (3, 3), activation='relu'))
model.add(Conv2D(30, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten()) …Run Code Online (Sandbox Code Playgroud)