Помогите пожалуйста (Please help)

from future import absolute_import, division, print_function, unicode_literals

import tensorflow as tf

from tensorflow import keras

model = models.Sequential()

model.add(layers.Conv2D(32, (3, 3), activation=‘relu’, input_shape=(32, 32, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation=‘relu’))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(128, (3, 3), activation=‘relu’))

model.add(layers.Flatten())
model.add(layers.Dense(128, activation=‘relu’))
model.add(layers.Dense(10, activation=‘softmax’))

model.compile(optimizer=‘adam’,
loss=‘sparse_categorical_crossentropy’,
metrics=[‘accuracy’])

model.summary()

I added the English translation to the title with translate.google.com. You need to ask a question or explain what you want.

1 Like

Before posting code, please read how to do this: About the Python Help category

In your code models and layers are not defined. You need to replace

from tensorflow import keras

by

from tensorflow.keras import models, layers
1 Like