onnx2keras icon indicating copy to clipboard operation
onnx2keras copied to clipboard

ValueError: Unknown layer: Functional

Open shivSD opened this issue 4 years ago • 0 comments

Keras: 2.1.6 Tensorflow = 1.13.1 Onnx = 1.2.1 Onnx2Keras = v0.0.22

convert onnx model to keras using about versions. Conversion successfully generates .hd5 model file and I try to load it using Keras using same configuration (versions), it complaints that Unknown layer: Functional.

here is the code and error logs

import tensorflow as tf
import keras
from keras.models import Model
from keras.models import load_model

model = load_model("/home/Documents/explorePrj/content/model.h5", compile=False)

    model = load_model("/home/Documents/explorePrj/content/model.h5", compile=False)
  File "/usr/local/lib/python3.6/dist-packages/keras/models.py", line 270, in load_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/models.py", line 347, in model_from_config
    return layer_module.deserialize(config, custom_objects=custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/layers/__init__.py", line 55, in deserialize
    printable_module_name='layer')
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py", line 138, in deserialize_keras_object
    ': ' + class_name)
ValueError: Unknown layer: Functional

shivSD avatar Oct 19 '20 19:10 shivSD