设计思路
输出结果
Using TensorFlow backend.
F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
None
2020-11-22 13:40:03.693339: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Found 17500 images belonging to 2 classes.
Found 7500 images belonging to 2 classes.
-------------显示网络结构--------------------
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_2 (InputLayer) (None, 4, 4, 512) 0
_________________________________________________________________
flatten_1 (Flatten) (None, 8192) 0
_________________________________________________________________
dense_1 (Dense) (None, 256) 2097408
_________________________________________________________________
activation_1 (Activation) (None, 256) 0
_________________________________________________________________
dropout_1 (Dropout) (None, 256) 0
_________________________________________________________________
dense_2 (Dense) (None, 1) 257
_________________________________________________________________
activation_2 (Activation) (None, 1) 0
=================================================================
Total params: 2,097,665
Trainable params: 2,097,665
Non-trainable params: 0
_________________________________________________________________
None
1488/1488 4s 2ms/step - loss: 0.0139 - acc: 0.9966 - val_loss: 1.0130 - val_acc: 0.8762
2000/2000 6s 3ms/step - loss: 0.0122 - acc: 0.9950 - val_loss: 0.7943 - val_acc: 0.9125
4000/4000 10s 2ms/step - loss: 0.0216 - acc: 0.9945 - val_loss: 0.9137 - val_acc: 0.8812
6000/6000 15s 2ms/step - loss: 0.0262 - acc: 0.9933 - val_loss: 0.6805 - val_acc: 0.8988
6992/6992 20s 3ms/step - loss: 0.0395 - acc: 0.9894 - val_loss: 0.6387 - val_acc: 0.8975
99980/99980 237s 2ms/step - loss: 0.0598 - acc: 0.9922 - val_loss: 1.2305 - val_acc: 0.9100