when I use coremltools convert the keras model(1st Updatable Models Examples) to mlmodel, the error shows up.
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 793, in convert
respect_trainable=respect_trainable)
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 579, in convertToSpec
respect_trainable=respect_trainable)
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/coremltools/converters/keras/_keras2_converter.py", line 326, in _convert
graph.build()
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/coremltools/converters/keras/_topology2.py", line 740, in build
self.make_input_layers()
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/coremltools/converters/keras/_topology2.py", line 169, in make_input_layers
if isinstance(kl, InputLayer) and kl.input == ts:
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 765, in __bool__
self._disallow_bool_casting()
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 534, in _disallow_bool_casting
self._disallow_in_graph_mode("using a tf.Tensor as a Python bool")
File "/Users/wills/virtualenv/Python3.7/TensorFlow/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 523, in _disallow_in_graph_mode
" this function with @tf.function.".format(task))
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.
```
mlmodel = keras_converter.convert(keras_model, input_names=['image'],
output_names=['personProbabilities'],
class_labels=class_labels,
predicted_feature_name='person')
absl-py 0.7.0
appnope 0.1.0
astor 0.7.1
attrs 19.1.0
backcall 0.1.0
bleach 3.1.0
coremltools 3.0b6
decorator 4.3.2
defusedxml 0.5.0
entrypoints 0.3
gast 0.2.2
google-pasta 0.1.7
grpcio 1.19.0
h5py 2.9.0
ipykernel 5.1.0
ipython 7.3.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
jedi 0.13.3
Jinja2 2.10
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.4.0
Keras 2.3.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
List 1.3.0
Markdown 3.0.1
MarkupSafe 1.1.1
mistune 0.8.4
mock 2.0.0
nbconvert 5.4.1
nbformat 4.4.0
notebook 5.7.4
numpy 1.16.2
opt-einsum 3.0.1
pandocfilters 1.4.2
parso 0.3.4
pbr 5.1.3
pexpect 4.6.0
pickleshare 0.7.5
pip 19.2.3
prometheus-client 0.6.0
prompt-toolkit 2.0.9
protobuf 3.7.0
ptyprocess 0.6.0
Pygments 2.3.1
pyrsistent 0.14.11
python-dateutil 2.8.0
PyYAML 5.1.2
pyzmq 18.0.0
qtconsole 4.4.3
scipy 1.3.1
Send2Trash 1.5.0
setuptools 41.2.0
six 1.12.0
style 1.1.0
tb-nightly 1.14.0a20190603
tensorboard 2.0.0
tensorflow 2.0.0rc2
tensorflow-estimator 1.13.0
termcolor 1.1.0
terminado 0.8.1
testpath 0.4.2
tf-estimator-nightly 1.14.0.dev2019080601
tfcoreml 0.4.0b1
tornado 6.0
traitlets 4.3.2
update 0.0.1
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.14.1
wheel 0.33.1
widgetsnbextension 3.4.2
wrapt 1.11.2
I solved that problem when using keras==2.2.4 and tensorflow==1.13.1.
Most helpful comment
I solved that problem when using keras==2.2.4 and tensorflow==1.13.1.