Эй, я пытаюсь преобразовать свою модель Keras в CoreML, но получаю эту ошибку:
tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a tf.Tensor as
a Python bool is not allowed in Graph execution. Use Eager execution or decorate this
function with @tf.function.
Вот мой код:
import keras
import coremltools
import tensorflow as tf
model = keras.models.load_model('machine.h5')
print(model.input)
print(model.input_shape)
print(model.output)
model= coremltools.converters.keras.convert(
'machine.h5', input_name_shape_dict={'embedding_input:0': (None, 24)},
output_names=['dense_2/Sigmoid:0'])
model.save('xcodeModel.mlmodel')
Не уверен, что я здесь неправильно. Надеюсь, на это есть ответ!