machine-learning - 如何更新tensorflow以支持tf.contrib?

标签 machine-learning tensorflow deep-learning

我想在 tf.contrib 模块中使用初始化程序和batch_norm,但我的程序说找不到它。我重新安装tensorflow仍然无法使用tf.contrib模块。谁能告诉我为什么?

最佳答案

我不知道你做了什么,但你肯定没有从 Google 获得最新的 Tensorflow 版本。您应该关注this tutorial安装它。

总结一下:

  1. 确保您具有依赖项:sudo apt-get install python-pip python-dev
  2. 卸载您现在拥有的所有内容:pip uninstall tensorflow
  3. 设置变量:

选择正确的一个:

# Ubuntu/Linux 64-bit, CPU only, Python 2.7
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.4
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.5
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
  • 安装
  • 选择正确的一个:

    # Python 2
    $ sudo pip install --upgrade $TF_BINARY_URL
    
    # Python 3
    $ sudo pip3 install --upgrade $TF_BINARY_URL
    

    关于machine-learning - 如何更新tensorflow以支持tf.contrib?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38386824/

    相关文章:

    machine-learning - 需要回答一些与机器学习相关的问题吗?

    python - 为什么这个神经网络的准确率为零,损失极低?

    machine-learning - 提供的模型不是 YellowBrick 中的聚类估计器

    python - 如何从 tensorflow 检查点文件正确恢复网络训练?

    python-2.7 - 对大型数据集执行 PCA

    c++ - 编译自定义 tf 操作,其中输入为 5d 张量

    python - tf.estimator.Estimator 中参数的混淆

    machine-learning - 深度学习: small dataset with keras : local minima

    text - weka 中的一元类文本分类?

    machine-learning - 错误模型语言