After having created a TensorFlow 1.4 model for Python 3, I have now found that Google Cloud ML Engine currently only has support for Python 2.7.
Back-porting my Python 3 code at first seemed simple enough: Some scripts still work as expected when I replace their shebang #!/usr/bin/env python3
with #!/usr/bin/env python
. python -V
reports 2.7.10
in my (macOS) environment.
Yet one script does not react so gracefully. When I run it now, it produces a Segmentation fault: 11
without any previous warnings or other diagnostic output.
How can I find out about the root cause, so that I know what else to change to make also that script palatable to Python 2?
UPDATE The segmentation fault apparently occurs during a call to session.run(get_next)
, where get_next
is obtained from a tf.data.Iterator
as follows:
iterator = dataset.make_initializable_iterator()
get_next = iterator.get_next()