无法在Google Colab中安装支持GPU的Tensorflow 2.0。

huangapple go评论68阅读模式
英文:

Unable to install Tensorflow 2.0 with GPU support in Google colaborate

问题

我正在尝试使用长短时记忆(LSTM)机器学习模型来预测股票价格,但无法在Google Colab中安装带有GPU支持的Tensorflow 2.0。

我尝试在索引数据库中搜索一个满足要求的索引,即tensorflow-gpu==2.0.0-alpha0,但未能找到。

英文:

I am trying to predict stock prices with a Long short-term memory (LSTM) machine learning model but am unable to as I cannot install Tensorflow 2.0 with GPU support in google colaborate.

I've tried searching the index database for an index that satisfies the requirement tensorflow-gpu==2.0.0-alpha0, but was unable to.

答案1

得分: 1

Tensorflow在Google Colab中已经预装了最新稳定版本。您只需使用以下代码导入Tensorflow:

import tensorflow as tf
tf.__version__

要使用GPU访问Tensorflow,您可以将Google Colab运行时更改为GPU。请按照以下步骤操作:

菜单(顶部) - 运行时 - 更改运行时类型 - 硬件加速器 - GPU - 保存

请使用以下代码确认GPU是否已启用:

tf.config.list_physical_devices()

由于Google Colab已升级到Python 3.10.12版本,根据此测试的构建配置,您将无法降级Tensorflow版本<2.8(Tensorflow 2.0要求最低Python 3.7)。

英文:

Tensorflow is already pre-installed with latest stable version in Google Colab. You can just import the tensorflow using below code:

import tensorflow as tf
tf.__version__

To access the Tensorflow with GPU, you can change the Google Colab runtime to GPU

Menu(top) - Runtime - Change runtime type - Hardware accelerator - GPU - Save

无法在Google Colab中安装支持GPU的Tensorflow 2.0。

Please use the code below to confirm if the GPU is enabled:

tf.config.list_physical_devices()

You will not be able to downgrade the Tensorflow version&lt;2.8(Tensorflow 2.0 require min python 3.7) as per this tested build configuration because Google colab has upgraded Python 3.10.12 version.

huangapple
  • 本文由 发表于 2023年6月15日 09:57:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76478598.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定