0

我想将模型分析添加到我的模型中,但无法导入库:

我正在使用数据实验室环境。

import tensorflow as tf
!pip install tensorflow_model_analysis
import tensorflow_model_analysis as tfma

错误是:

ImportErrorTraceback (most recent call last)
<ipython-input-6-f85e4d8fbd99> in <module>()
----> 1 import tensorflow_model_analysis as tfma

/usr/local/envs/py2env/lib/python2.7/site-packages/tensorflow_model_analysis/__init__.py in <module>()
     15 
     16 
---> 17 from tensorflow_model_analysis import view
     18 from tensorflow_model_analysis.api import tfma_unit as test
     19 from tensorflow_model_analysis.api.model_eval_lib import *  # pylint: disable=wildcard-import

ImportError: cannot import name view

请建议什么是导入库的正确方法。

谢谢,埃拉兰

4

1 回答 1

1

现在使用以下安装为我工作:

python 2.7 - to support apache beam
pip install pip==9.0.3  # I am not sure what is the reason, but essential for apache beam pipelines execution
pip install --upgrade tensorflow
pip install tensorflow-model-analysis
import tensorflow_model_analysis as tfma
于 2018-11-20T14:20:31.193 回答