代码之家  ›  专栏  ›  技术社区  ›  eilalan

ImportError:将tensorflow_model_分析导入为tfma[PYTHON on datalab]

  •  0
  • eilalan  · 技术社区  · 6 年前

    使用DataAM环境。

    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
    

    请告知导入库的正确方法。

    埃拉兰

    1 回复  |  直到 6 年前
        1
  •  1
  •   eilalan    6 年前

    正在为我使用以下安装:

    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