Код: Выделить всё
from tensorflow.keras.applications import ResNet50, ResNet101, ResNet152, InceptionResNetV2, DenseNet121
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, Activation, BatchNormalization
from tensorflow.keras import mixed_precision, layers, models
import tensorflow as tf
from tensorflow.keras.optimizers.schedules import ExponentialDecay
from tensorflow.keras.optimizers import Adam, RMSprop
mixed_precision.set_global_policy('mixed_float16')
base_model = ResNet152(weights='imagenet', include_top=False, input_shape=(256, 256, 3))
for layer in base_model.layers:
layer.trainable = True
pooling_layer = layers.GlobalAveragePooling2D()(base_model.output) # GlobalAveragePooling2D layer
output_layer = layers.Dense(1, activation='sigmoid', name='output_layer')(pooling_layer)
model = Model(inputs=base_model.input, outputs=output_layer)
initial_learning_rate = 0.001
lr_schedule = ExponentialDecay(
initial_learning_rate,
decay_steps=50, # Adjust the decay steps as needed
decay_rate=0.9, # Adjust the decay rate as needed
staircase=False)
optimizer = Adam(learning_rate=lr_schedule)
model.compile(
optimizer=optimizer,
loss='binary_crossentropy',
metrics=['accuracy', tf.keras.metrics.Precision(), tf.keras.metrics.Recall(), tf.keras.metrics.AUC(name='auc')]
)
model.summary()
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
history = model.fit(dataset_batched_withoutnames, epochs=5)
Библиотека DNN не найдена.
[[{{node model/conv1_conv/Conv2D}} ]] [Op:__inference_train_function_55822]
(есть длинное поле, но я не копировал и вставлял его целиком)
Я вернулся и понизил версию Tensorflow, CUDA и cuDNN. Я использую CUDA 11.2, cuDNN 8.1.0 и Tensorflow 2.10.0
Я вернулся к своим путям, все очистил и добавил в путь все следующее

Я не понимаю, почему это не работает . У кого-нибудь есть идеи?
Подробнее здесь: https://stackoverflow.com/questions/786 ... ot-working