【问题标题】:How to update tensorflow to support tf.contrib?如何更新 tensorflow 以支持 tf.contrib?
【发布时间】:2016-07-15 02:06:23
【问题描述】:

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

【问题讨论】:

  • 你有哪个tensorflow版本print(tf.__version__)
  • 我尝试这个命令得到:'module' object has no attribute 'version'
  • 我找到了。 2.0 版。我是不是安装错了?
  • 0.9.0rc0 是最新版本。我猜你有0.2.X?你在哪里找到的版本?
  • 来自 init.py 在 tensorflow 文件夹中

标签: machine-learning tensorflow deep-learning


【解决方案1】:

我不知道你做了什么,但你肯定没有来自 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
  1. 安装它

选择正确的一个:

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

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

【讨论】:

  • 我再次使用 anaconda install 并成功。谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-26
  • 2015-02-22
  • 2018-12-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多