Hi,大家好,我是源于花海。要讓一個(gè)基于 CPU 的?tensorflow 和 keras 開發(fā)的深度學(xué)習(xí)模型正確運(yùn)行起來,配置環(huán)境是個(gè)重要的問題,本文介紹了 tensorflow 和 keras 和對應(yīng)的 python 版本以及安裝環(huán)境的部分流程。
目錄
一、tensorflow +?keras?+ python 版本對照
二、tensorflow 和 keras 安裝流程
一、tensorflow +?keras?+ python 版本對照
詳情看?tensorflow 官網(wǎng)鏈接如下:
??????Build from source on Windows ?|? TensorFlow (google.cn)文章來源:http://www.zghlxwxcb.cn/news/detail-823593.html
Framework | Python version | Description |
---|---|---|
TensorFlow 2.9 | 3.7.-3.10. | TensorFlow 2.9.0 + Keras |
TensorFlow 2.8 | 3.7.-3.10. | TensorFlow 2.8.0 + Keras |
TensorFlow 2.7 | 3.7.-3.9. | TensorFlow 2.7.0 + Keras |
TensorFlow 2.6 | 3.6.-3.9. | TensorFlow 2.6.0 + Keras 2.6.0 |
TensorFlow 2.5 | 3.6.-3.9. | TensorFlow 2.5.0 + Keras 2.5 |
TensorFlow 2.4 | 3.6.-3.8. | TensorFlow 2.4.0 + Keras 2.4.3 |
TensorFlow 2.3 | 3.5.-3.8. | TensorFlow 2.3.0 + Keras 2.4.3 |
TensorFlow 2.2 | 3.7. | TensorFlow 2.2.0 + Keras 2.3.1 |
TensorFlow 2.1 | 3.6. | TensorFlow 2.1.0 + Keras 2.3.1 |
TensorFlow 2.0 | 3.6. | TensorFlow 2.0.0 + Keras 2.3.1 |
TensorFlow 1.15 | 3.6. | TensorFlow 1.15.0 + Keras 2.3.1 |
TensorFlow 1.14 | 3.6. | TensorFlow 1.14.0 + Keras 2.2.5 |
TensorFlow 1.13 | 3.6. | TensorFlow 1.13.0 + Keras 2.2.4 |
TensorFlow 1.12 | 3.6. | TensorFlow 1.12.0 + Keras 2.2.4 |
2. | TensorFlow 1.12.0 + Keras 2.2.4 | |
TensorFlow 1.11 | 3.6. | TensorFlow 1.11.0 + Keras 2.2.4 |
2. | TensorFlow 1.11.0 + Keras 2.2.4 | |
TensorFlow 1.10 | 3.6. | TensorFlow 1.10.0 + Keras 2.2.0 |
2. | TensorFlow 1.10.0 + Keras 2.2.0 | |
TensorFlow 1.9 | 3.6. | TensorFlow 1.9.0 + Keras 2.2.0 |
2. | TensorFlow 1.9.0 + Keras 2.2.0 | |
TensorFlow 1.8 | 3.6. | TensorFlow 1.8.0 + Keras 2.1.6 |
2. | TensorFlow 1.8.0 + Keras 2.1.6 | |
TensorFlow 1.7 | 3.6. | TensorFlow 1.7.0 + Keras 2.1.6 |
2. | TensorFlow 1.7.0 + Keras 2.1.6 | |
TensorFlow 1.5 | 3.6. | TensorFlow 1.5.0 + Keras 2.1.6 |
2. | TensorFlow 1.5.0 + Keras 2.0.8 | |
TensorFlow 1.4 | 3.6. | TensorFlow 1.4.0 + Keras 2.0.8 |
2. | TensorFlow 1.4.0 + Keras 2.0.8 | |
TensorFlow 1.3 | 3.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 是我做的語義分割項(xiàng)目的虛擬環(huán)境),若需要將創(chuàng)建的虛擬環(huán)境添加到 jupyter lab/notebook 中使用,則需要第 3 - 6 步,否則不用:文章來源地址http://www.zghlxwxcb.cn/news/detail-823593.html
# 1. Anaconda 創(chuàng)建虛擬環(huán)境
conda create -n segnet python=3.8
# 2. 激活并進(jìn)入虛擬環(huán)境
activate segnet
# 3. 安裝 ipykernel
pip install ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple/
# 4. 安裝ipykernel,將虛擬環(huán)境加入 jupyter?內(nèi)核中
python -m ipykernel install --name segnet --display-name segnet
# 5. 檢查新虛擬環(huán)境是否成功加入內(nèi)核
jupyter kernelspec list
# 6. 從指定文件夾里進(jìn)入 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
到了這里,關(guān)于深度學(xué)習(xí) | 基于 CPU 的 tensorflow + keras + python 版本對照及環(huán)境安裝的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!