DwangoMediaVillage / keras_compressor

Model Compression CLI Tool for Keras.
https://nico-opendata.jp/ja/casestudy/model_compression/index.html
157 stars 39 forks source link

Problem with loading the compressed model #20

Open dsnsabari opened 4 years ago

dsnsabari commented 4 years ago

While loading the compressed model , I am getting the below error.

File "C:\Users\user\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 138, in deserialize_keras_object ': ' + class_name)

ValueError: Unknown layer: FactorizedConv2DTucker

from keras.models import load_model

model0 = load_model('E:/Model_Compression/keras_compressor-master/example/mnist/model_compressed.h5')

sunejas commented 4 years ago

Hi @dsnsabari, i am facing the same issue, did you find any solution for this ?

sunejas commented 4 years ago

Resolved above error on loading compressed model as: model = load_model(model_path, custom_objects) where custom objects = {'FactorizedConv2DTucker': <class 'keras_compressor.layers.FactorizedConv2DTucker'>, 'FactorizedDense': <class 'keras_compressor.layers.FactorizedDense'>}

but now facing this error : "ValueError: Unknown metric function: {'class_name': 'MeanMetricWrapper', 'config': {'name': 'accuracy', 'dtype': 'float32'}}"

any idea how to reslove this?!

ZhaoYibo61 commented 3 years ago

@sunejas Has this problem been solved?