头哥学 keras

本人的机器  : Win10  64位    

显卡     Quadro P520               |          CUDA  10.1.120

1)先安装 python  3.6.6   (不要3.7 和 3.8)   

    安装完了之后 用 python -V (大写的v)   瞅一眼

2)tensorflow 1.4.0      必须匹配   keras 2.0.8    

 numpy==1.16.0(不用这个 会蹦warning)

  matplotlib(随意)

安装命令   

```

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

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

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.16.0

```

3)

https://www.jianshu.com/p/e9c1e68a615e  

用这个入门

4)

以下代码 保存为 test.py  ,然后运行 python test.py    

import tensorflow as tf

mnist = tf.keras.datasets.mnist # 28 x 28 images of hand-written digits 0-9

#### 可视化数据

from keras.models import Sequential

model = Sequential()

from keras.layers import Dense

model.add(Dense(units=64, activation='relu', input_dim=100))

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

model.compile(loss='categorical_crossentropy',

              optimizer='sgd',

              metrics=['accuracy'])


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容