本人的機(jī)器? : Win10? 64位? ??
顯卡? ? ?Quadro P520? ? ? ? ? ? ? ?|? ? ? ? ? CUDA? 10.1.120
1)先安裝 python? 3.6.6? ?(不要3.7 和 3.8)? ?
? ? 安裝完了之后 用 python -V (大寫(xiě)的v)? ?瞅一眼
2)tensorflow 1.4.0? ? ? 必須匹配? ?keras 2.0.8? ??
?numpy==1.16.0(不用這個(gè) 會(huì)蹦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)
http://www.itdecent.cn/p/e9c1e68a615e??
用這個(gè)入門(mén)
4)
以下代碼 保存為 test.py? ,然后運(yùn)行 python test.py? ??
import tensorflow as tf
mnist = tf.keras.datasets.mnist # 28 x 28 images of hand-written digits 0-9
#### 可視化數(shù)據(jù)
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'])