Я новичок в машинном обучении, когда я загружаю обученную модель, она записывает:
NameError Traceback (most recent call last)
<ipython-input-35-6dccbca49d08> in <module>()
2 from keras.utils.vis_utils import model_to_dot
3 from keras.models import *
----> 4 model = load_model("/content/models/inceptionV3-imagenet-finetune{}-adam.h5".format(fine_tune_layer))
5 print("load successed")
10 frames
/usr/local/lib/python3.6/dist-packages/keras/layers/core.py in wrapper(*args, **kwargs)
14
15 def wrapper(*args, **kwargs):
---> 16 kwargs['backend'] = backend
17 kwargs['layers'] = layers
18 kwargs['models'] = models
NameError: name 'backend' is not defined
Это код моей модели:
input_tensor = Input((*model_image_size, 3))
from keras.applications.inception_v3 import preprocess_input as PreprocessInput
from keras.applications.inception_v3 import InceptionV3
from keras import backend as K
x = input_tensor
x = Lambda(PreprocessInput)(x)
base_model = InceptionV3(input_tensor=x, weights='imagenet', include_top=False)
x = GlobalAveragePooling2D()(base_model.output)
x = Dropout(0.5)(x)
x = Dense(10, activation='softmax')(x)
model = Model(base_model.input, x)
Пожалуйста, помогите мне, спасибо очень много!