英文:
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
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<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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论