我下载了tfma源码0.13.2,在本地用python2在jupyter notebook中运行,还是不行
工作代码:
import tensorflow as tf
import third_party.tensorflow_model_analysis.tensorflow_model_analysis.version as v
print('TFMA version: {}'.format(v.VERSION_STRING))
Output is:
TFMA version: 0.13.1
不工作的代码:
import third_party.tensorflow_model_analysis.tensorflow_model_analysis.types as types
model_location = '/tmp/model0712/export/tfma/1562953448'
eval_shared_model = types.EvalSharedModel(model_path=model_location)
Output is:
....third_party/tensorflow_model_analysis/tensorflow_model_analysis/types.py", line 54
value: float,
^
SyntaxError: invalid syntax
似乎只有 Python 3 支持类型提示,所以上述错误对我来说是合理的。
然而,这是否意味着 tfma 代码不能在 Python 2 中运行,尽管 github 页面说它与 Python2.7 兼容?
还是我错过了什么?