我正在尝试加载我使用线程训练的keras模型

self.load_modelThread = Thread(target=utils.load_model, args=(self,))
self.load_modelThread.start()


def load_model(gui_window):
try:
    json_file = open('Data\\Gestures\\gestures_model.json', 'r')
    loaded_model_json = json_file.read()
    json_file.close()
    model = model_from_json(loaded_model_json)
    model._make_predict_function()
    #load the weights of the pretrained model
    model.load_weights("Data\\Gestures\\weights.hdf5")
    print("Model successfully loaded from disk.")
    #logger.info("Model successfully loaded from disk.")   
    global graph
    graph = tf.get_default_graph()
    # compile the model again
    model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
    gui_window.gesturesModel = model
except: print('No model')

我第一次运行代码时模型被加载 . 我得到的每一次

无法将feed_dict键解释为Tensor:Tensor Tensor(“Placeholder_90:0”,shape =(7,7,3,32),dtype = float32)不是此图的元素 .

其中shape =(7,7,3,32)是第一CNN层的形状

我把这行包括在“model._make_predict_function()”中,但它没有帮助 . 当我在不使用线程的情况下加载时,一切正常 . 我使用的是python 3.6,最近更新了keras和tensorflow