TensorFlow、Keras、Python 版本匹配一览表

人工智能31

TensorFlow、Keras、Python 版本匹配一览表

兴冲冲装完软件,发现运行不了,查了下资料,发现是TensorFlow、Keras、Python 版本匹配问题。这里提供一个版本匹配清单,需要严格按此标准安装。

版本匹配清单

FrameworkEnv nameDescriptionTensorFlow 2.2tensorflow-2.2TensorFlow 2.2.0 + Keras 2.3.1 on Python 3.7.TensorFlow 2.1tensorflow-2.1TensorFlow 2.1.0 + Keras 2.3.1 on Python 3.6.TensorFlow 2.0tensorflow-2.0TensorFlow 2.0.0 + Keras 2.3.1 on Python 3.6.TensorFlow 1.15tensorflow-1.15TensorFlow 1.15.0 + Keras 2.3.1 on Python 3.6.TensorFlow 1.14tensorflow-1.14TensorFlow 1.14.0 + Keras 2.2.5 on Python 3.6.TensorFlow 1.13tensorflow-1.13TensorFlow 1.13.0 + Keras 2.2.4 on Python 3.6.TensorFlow 1.12tensorflow-1.12TensorFlow 1.12.0 + Keras 2.2.4 on Python 3.6.tensorflow-1.12:py2TensorFlow 1.12.0 + Keras 2.2.4 on Python 2.TensorFlow 1.11tensorflow-1.11TensorFlow 1.11.0 + Keras 2.2.4 on Python 3.6.tensorflow-1.11:py2TensorFlow 1.11.0 + Keras 2.2.4 on Python 2.TensorFlow 1.10tensorflow-1.10TensorFlow 1.10.0 + Keras 2.2.0 on Python 3.6.tensorflow-1.10:py2TensorFlow 1.10.0 + Keras 2.2.0 on Python 2.TensorFlow 1.9tensorflow-1.9TensorFlow 1.9.0 + Keras 2.2.0 on Python 3.6.tensorflow-1.9:py2TensorFlow 1.9.0 + Keras 2.2.0 on Python 2.TensorFlow 1.8tensorflow-1.8TensorFlow 1.8.0 + Keras 2.1.6 on Python 3.6.tensorflow-1.8:py2TensorFlow 1.8.0 + Keras 2.1.6 on Python 2.TensorFlow 1.7tensorflow-1.7TensorFlow 1.7.0 + Keras 2.1.6 on Python 3.6.tensorflow-1.7:py2TensorFlow 1.7.0 + Keras 2.1.6 on Python 2.TensorFlow 1.5tensorflow-1.5TensorFlow 1.5.0 + Keras 2.1.6 on Python 3.6.tensorflow-1.5:py2TensorFlow 1.5.0 + Keras 2.0.8 on Python 2.TensorFlow 1.4tensorflow-1.4TensorFlow 1.4.0 + Keras 2.0.8 on Python 3.6.tensorflow-1.4:py2TensorFlow 1.4.0 + Keras 2.0.8 on Python 2.TensorFlow 1.3tensorflow-1.3TensorFlow 1.3.0 + Keras 2.0.6 on Python 3.6.tensorflow-1.3:py2TensorFlow 1.3.0 + Keras 2.0.6 on Python 2.

附上一段测试程序(鸢尾花分类简化版)

这一段代码不需要准备数据文件,可直接验证是否可以训练模型。


import numpy as np
import keras
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense

train_x = np.array([[1.4, 0.2],
                        [1.7, 0.4],
                        [1.5, 0.4],
                        [2.3, 0.7],
                        [2.7, 1.1],
                        [2.6, 0.9],
                        [4.6, 1.3],
                        [3.5, 1.0],
                        [3.9, 1.2]])
train_y = np.array([[1, 0, 0],
                        [1, 0, 0],
                        [1, 0, 0],
                        [0, 1, 0],
                        [0, 1, 0],
                        [0, 1, 0],
                        [0, 0, 1],
                        [0, 0, 1],
                        [0, 0, 1]])

model = Sequential()
model.add(Dense(units = 2, input_dim = 2))

model.add(Dense(units = 3, activation = 'softmax'))

model.compile(optimizer = 'adam', loss = 'mse')

model.fit(x = train_x, y = train_y, epochs = 10000)

keras.models.save_model(model, 'iris2.model')

Original: https://blog.csdn.net/quicmous/article/details/124328289
Author: 许野平
Title: TensorFlow、Keras、Python 版本匹配一览表

相关文章
当推荐系统遇上多模态Embedding 人工智能

当推荐系统遇上多模态Embedding

在微信视视频号推荐算法大赛中,给出来融合了OCR、ASR、图像、文字的多模态的内容理解特征向量Feed Embedding,共512维向量。对于给定的一定数量到访过微信视频号"热门推荐"的用户,根据这...
人工智能重新定义管理 人工智能

人工智能重新定义管理

转载请注明:来自csdn以及备注作者,本文原创 孙子兵法中有一句话:知彼知己,胜乃不殆,知天知地,胜乃不穷。这或许是最早提出的内外部环境分析的思想。最近几年,我们面临着创新创业的大环境,"互联网+"、...
OpenCV配置教程 人工智能

OpenCV配置教程

文章目录 前言 一、下载和安装OpenCV SDK 二、配置包含路径 三、配置库目录&配置链接器 四、配置环境变量 五、dll文件复制到system32中 六、验证配置结果 七、结语 前言 本...