Tensorflow ValueError:未知层:功能

时间:2020-09-19 10:01:44

标签: python tensorflow machine-learning keras classification

  model_path = './models/VGG16_res.h5'
  
  model = load_model(model_path)

这是我用来加载模型的代码

TensorFlow版本:2.3.0 我不确定为什么会收到此错误:

Using TensorFlow backend.
2020-09-19 04:49:24.824483: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-09-19 04:49:24.843953: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "app.py", line 19, in <module>
    model = load_model(model_path)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 243, in load_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 317, in model_from_config
    return layer_module.deserialize(config, custom_objects=custom_objects)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\layers\__init__.py", line 55, in deserialize
    printable_modul## Heading ##e_name='layer')
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\generic_utils.py", line 138, in deserialize_keras_object
    ': ' + class_name)
ValueError: Unknown layer: Functional

这是我的模型h5(VGG16)

enter image description here

0 个答案:

没有答案