Closed Ostralyan closed 4 months ago
The max version of TensorFlow 2 that we support is 2.12.0
. You should have received a warning about this when importing coremltools. Please try with that version of TensorFlow.
Ahhh yes I see it now, the stack trace just pushed it back that I missed it.
That solved it. Thank you!
Ahhh yes I see it now, the stack trace just pushed it back that I missed it.
That solved it. Thank you!
I cannot install 2.12.0
tensorflow, the minimal version is 2.16.0. How do you install?
The max version of TensorFlow 2 that we support is
2.12.0
. You should have received a warning about this when importing coremltools. Please try with that version of TensorFlow. I canno install2.12.0
tensorflow: ERROR: Could not find a version that satisfies the requirement tensorflow==2.12.0 (from versions: 2.16.0rc0, 2.16.1, 2.16.2, 2.17.0rc0, 2.17.0rc1, 2.17.0, 2.17.1, 2.18.0rc0, 2.18.0rc1, 2.18.0rc2, 2.18.0)
🐞Describing the bug
Unable to convert tensorflow model to coreml model.
Stack Trace
To Reproduce
Compile the model
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
Train the model
model.fit(X_train, y_train, epochs=10, batch_size=32, validation_data=(X_test, y_test))
Evaluate the model
loss, accuracy = model.evaluate(X_test, y_test) print(f'Accuracy on test data: {accuracy}')
model.save("my_model.mlpackage")
mlmodel = coremltools.convert(model, convert_to="mlprogram", source="tensorflow")