頭哥學(xué) keras

本人的機(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'])


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容