Why I cannot import Tensorflow.contrib I get an error of No module named 'tensorflow.python.saved

后端 未结 7 1249
离开以前
离开以前 2020-12-05 18:25

Hi I just installed Tensorflow on my Mac and I want to use tf.contrib.slim but when I use it I get this

import tensorflow as tf

s         


        
相关标签:
7条回答
  • 2020-12-05 18:47

    for running it on python3 I used pip3 to install

    pip3 install tensorflow
    

    This worked for me

    0 讨论(0)
  • 2020-12-05 18:47

    Starting from tensorflow 13.1 there's no contrib. You can use without it slim = tf.slim or you can install pip install tensorflow==1.13 and use it

    0 讨论(0)
  • 2020-12-05 18:52

    first unistall tensorflow

    pip uninstall tensorflow
    

    then install 1.13.2 version

    pip install tensorflow==1.13.2
    

    it works.. had the same issue.. but installing tensorflow 1.13.2 solved it!
    the newer version of tensorflow doesn't have

    0 讨论(0)
  • 2020-12-05 18:55

    Currently the default install of tensorflow is 2.x while your code is for 1.x. The contrib module has been removed from tf 2.x. Check the warnings:

    "The TensorFlow contrib module will not be included in TensorFlow 2.0"

    Uninstall tensorflow and then install the 1.x version with

    pip install tensorflow==1.15
    
    0 讨论(0)
  • 2020-12-05 19:00

    tf.contrib has moved out of TF starting TF 2.0 alpha.

    You can upgrade your TF 1.x code to TF 2.x using the tf_upgrade_v2 script https://www.tensorflow.org/alpha/guide/upgrade

    0 讨论(0)
  • 2020-12-05 19:02

    I solved this by below method.

      pip uninstall tensorflow_estimator
      pip install tensorflow_estimator
    

    the reference is : https://github.com/tensorflow/tensorflow/issues/27079

    0 讨论(0)
提交回复
热议问题