快速安装Keras、tensorflow

 

1、安装tensorflow

pip install --upgrade tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple

2、安装Keras

pip install --upgrade keras -i https://pypi.tuna.tsinghua.edu.cn/simple

超级快!!!

检验是否安装成功:

from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Activation

# Dense 全连接层
layers = [Dense(32, input_shape=(784,)), # 32,784 核数
          Activation('relu'), # 激活函数
          Dense(10),
          Activation('softmax')]

model = Sequential(layers)
model.summary()

运行结果:

快速安装Keras、tensorflow_第1张图片

默默地学习,笨笨地成长!更多精彩内容欢迎大家关注微信公众号小果果学长,和你一起成长和学习哦!

快速安装Keras、tensorflow_第2张图片

你可能感兴趣的:(小工具,Python)