Я пытаюсь конвертировать, а не загружать мою модель в CoreML, но она продолжает выдавать мне эту ошибку, и у меня НЕТ ИДЕИ, как ее исправить.
Вот мой код:
import keras
import coremltools
import tensorflow as tf
model = tf.keras.models.load_model('machine')
print(model.summary())
output_labels = ['0', '1']
model = coremltools.converters.keras.convert('machine', input_names=
['text'], output_names=['output'])
model.author = 'Aarush'
model.short_description = 'My model'
model.input_description['text'] = 'Takes text as an input'
model.output_description['output'] = 'Prediction of CyberBullying
sentiment'
model.save('xcodeModel.mlmodel')
ERROR:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-62-5bde9de3c9f8> in <module>()
1 output_labels = ['0', '1']
2
----> 3 model = coremltools.converters.keras.convert('machine', input_names=['text'], output_names=['output'])
4
5 model.author = 'Aarush'
21 frames
/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
138 if cls is None:
139 raise ValueError('Unknown ' + printable_module_name +
--> 140 ': ' + class_name)
141 if hasattr(cls, 'from_config'):
142 custom_objects = custom_objects or {}
ValueError: Unknown initializer: GlorotUniform
PS
Я пытался сделать import keras
, tf.keras
, а также createObject
, но ни один из них не работает , Любая помощь будет оценена.
Спасибо