当前位置: 代码网 > it编程>前端脚本>Python > 深度学习 | 基于 CPU 的 tensorflow + keras + python 版本对照及环境安装

深度学习 | 基于 CPU 的 tensorflow + keras + python 版本对照及环境安装

2024年08月04日 Python 我要评论
Hi,大家好,我是半亩花海。要让一个基于 CPU 的 tensorflow 和 keras 开发的深度学习模型正确运行起来,配置环境是个重要的问题,本文介绍了 tensorflow 和 keras 和对应的 python 版本以及安装环境的部分流程。

目录

一、tensorflow + keras + python 版本对照

二、tensorflow 和 keras 安装流程


一、tensorflow + keras + python 版本对照

详情看 tensorflow 官网链接如下:

​​​​​​build from source on windows  |  tensorflow (google.cn)

frameworkpython versiondescription
tensorflow 2.93.7.-3.10.tensorflow 2.9.0 + keras
tensorflow 2.83.7.-3.10.tensorflow 2.8.0 + keras
tensorflow 2.73.7.-3.9.tensorflow 2.7.0 + keras
tensorflow 2.63.6.-3.9.tensorflow 2.6.0 + keras 2.6.0
tensorflow 2.53.6.-3.9.tensorflow 2.5.0 + keras 2.5
tensorflow 2.43.6.-3.8.tensorflow 2.4.0 + keras 2.4.3
tensorflow 2.33.5.-3.8.tensorflow 2.3.0 + keras 2.4.3
tensorflow 2.23.7.tensorflow 2.2.0 + keras 2.3.1
tensorflow 2.13.6.tensorflow 2.1.0 + keras 2.3.1
tensorflow 2.03.6.tensorflow 2.0.0 + keras 2.3.1
tensorflow 1.153.6.tensorflow 1.15.0 + keras 2.3.1
tensorflow 1.143.6.tensorflow 1.14.0 + keras 2.2.5
tensorflow 1.133.6.tensorflow 1.13.0 + keras 2.2.4
tensorflow 1.123.6.tensorflow 1.12.0 + keras 2.2.4
2.tensorflow 1.12.0 + keras 2.2.4
tensorflow 1.113.6.tensorflow 1.11.0 + keras 2.2.4
2.tensorflow 1.11.0 + keras 2.2.4
tensorflow 1.103.6.tensorflow 1.10.0 + keras 2.2.0
2.tensorflow 1.10.0 + keras 2.2.0
tensorflow 1.93.6.tensorflow 1.9.0 + keras 2.2.0
2.tensorflow 1.9.0 + keras 2.2.0
tensorflow 1.83.6.tensorflow 1.8.0 + keras 2.1.6
2.tensorflow 1.8.0 + keras 2.1.6
tensorflow 1.73.6.tensorflow 1.7.0 + keras 2.1.6
2.tensorflow 1.7.0 + keras 2.1.6
tensorflow 1.53.6.tensorflow 1.5.0 + keras 2.1.6
2.tensorflow 1.5.0 + keras 2.0.8
tensorflow 1.43.6.tensorflow 1.4.0 + keras 2.0.8
2.tensorflow 1.4.0 + keras 2.0.8
tensorflow 1.33.6.tensorflow 1.3.0 + keras 2.0.6
2.tensorflow 1.3.0 + keras 2.0.6

二、tensorflow 和 keras 安装流程

这里安装 python=3.8,tensorflow=2.4.0,keras=2.4.3(segnet 是我做的语义分割项目的虚拟环境)若需要将创建的虚拟环境添加到 jupyter lab/notebook 中使用,则需要第 3 - 6 步,否则不用

# 1. anaconda 创建虚拟环境
conda create -n segnet python=3.8
# 2. 激活并进入虚拟环境
activate segnet
# 3. 安装 ipykernel 
pip install ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple/
# 4. 安装ipykernel,将虚拟环境加入 jupyter 内核中
python -m ipykernel install --name segnet --display-name segnet
# 5. 检查新虚拟环境是否成功加入内核
jupyter kernelspec list
# 6. 从指定文件夹里进入 jupyter
jupyter lab
# 7. 安装 tensorflow、keras 等软件包
pip install tensorflow==2.4.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install keras==2.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
------------------------------------------------------------------------
pip install matplotlib==3.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install numpy==1.19.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pillow==10.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install scipy==1.7.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com