Found 3400 files belonging to 2 classes.
Using 2720 files for training.
Found 3400 files belonging to 2 classes.
Using 680 files for validation.
['cat', 'dog']
for image_batch, labels_batch in train_ds:print(image_batch.shape)print(labels_batch.shape)break
from tensorflow.keras import layers, models, Input
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dense, Flatten, Dropout
defVGG16(nb_classes, input_shape):
input_tensor = Input(shape=input_shape)# 1st block
x = Conv2D(64,(3,3), activation='relu', padding='same',name='block1_conv1')(input_tensor)
x = Conv2D(64,(3,3), activation='relu', padding='same',name='block1_conv2')(x)
x = MaxPooling2D((2,2), strides=(2,2), name ='block1_pool')(x)# 2nd block
x = Conv2D(128,(3,3), activation='relu', padding='same',name='block2_conv1')(x)
x = Conv2D(128,(3,3), activation='relu', padding='same',name='block2_conv2')(x)
x = MaxPooling2D((2,2), strides=(2,2), name ='block2_pool')(x)# 3rd block
x = Conv2D(256,(3,3), activation='relu', padding='same',name='block3_conv1')(x)
x = Conv2D(256,(3,3), activation='relu', padding='same',name='block3_conv2')(x)
x = Conv2D(256,(3,3), activation='relu', padding='same',name='block3_conv3')(x)
x = MaxPooling2D((2,2), strides=(2,2), name ='block3_pool')(x)# 4th block
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block4_conv1')(x)
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block4_conv2')(x)
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block4_conv3')(x)
x = MaxPooling2D((2,2), strides=(2,2), name ='block4_pool')(x)# 5th block
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block5_conv1')(x)
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block5_conv2')(x)
x = Conv2D(512,(3,3), activation='relu', padding='same',name='block5_conv3')(x)
x = MaxPooling2D((2,2), strides=(2,2), name ='block5_pool')(x)# full connection
x = Flatten()(x)
x = Dense(4096, activation='relu', name='fc1')(x)
x = Dense(4096, activation='relu', name='fc2')(x)
output_tensor = Dense(nb_classes, activation='softmax', name='predictions')(x)
model = Model(input_tensor, output_tensor)return model
model=VGG16(1000,(img_width, img_height,3))
model.summary()
Epoch 1/10: 7%| | 3/43 [00:58<12:50, 19.26s/it, train_loss=817908992.0000, train_acc=0.4844, lr=0.
WARNING:tensorflow:5 out of the last 5 calls to <function TensorFlowTrainer.make_train_function.<locals>.one_step_on_iterator at 0x0000026D58AB2670> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Epoch 1/10: 9%| | 4/43 [01:17<12:21, 19.02s/it, train_loss=33623308288.0000, train_acc=0.4844, lr=
WARNING:tensorflow:6 out of the last 6 calls to <function TensorFlowTrainer.make_train_function.<locals>.one_step_on_iterator at 0x0000026D58AB2670> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Epoch 1/10: 100%|█| 43/43 [13:22<00:00, 18.66s/it, train_loss=3165756416.0000, train_acc=0.4989, lr=
开始验证!
Epoch 1/10: 36%|███▋ | 4/11 [00:19<00:34, 4.88s/it, val_loss=2893433856.0000, val_acc=0.4940]
WARNING:tensorflow:5 out of the last 5 calls to <function TensorFlowTrainer.make_test_function.<locals>.one_step_on_iterator at 0x0000026DDF2E49D0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Epoch 1/10: 45%|████▌ | 5/11 [00:24<00:29, 4.87s/it, val_loss=2832519680.0000, val_acc=0.4951]
WARNING:tensorflow:6 out of the last 6 calls to <function TensorFlowTrainer.make_test_function.<locals>.one_step_on_iterator at 0x0000026DDF2E49D0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Epoch 1/10: 100%|█████████| 11/11 [00:51<00:00, 4.70s/it, val_loss=2532606720.0000, val_acc=0.4974]
结束验证!
验证loss为:2787614720.0000
验证准确率为:0.4958
Epoch 2/10: 100%|█| 43/43 [13:03<00:00, 18.23s/it, train_loss=1423662976.0000, train_acc=0.5020, lr=
开始验证!
Epoch 2/10: 100%|█████████| 11/11 [00:52<00:00, 4.74s/it, val_loss=1281297920.0000, val_acc=0.5026]
结束验证!
验证loss为:1341318784.0000
验证准确率为:0.5034
Epoch 3/10: 100%|█| 43/43 [13:02<00:00, 18.19s/it, train_loss=915221888.0000, train_acc=0.5022, lr=0
开始验证!
Epoch 3/10: 100%|██████████| 11/11 [00:52<00:00, 4.75s/it, val_loss=854207104.0000, val_acc=0.5026]
结束验证!
验证loss为:880286656.0000
验证准确率为:0.5031
Epoch 4/10: 100%|█| 43/43 [13:04<00:00, 18.24s/it, train_loss=674374464.0000, train_acc=0.5006, lr=0
开始验证!
Epoch 4/10: 100%|██████████| 11/11 [00:51<00:00, 4.71s/it, val_loss=640655744.0000, val_acc=0.5001]
结束验证!
验证loss为:655163968.0000
验证准确率为:0.4998
Epoch 5/10: 100%|█| 43/43 [13:01<00:00, 18.18s/it, train_loss=533879808.0000, train_acc=0.5004, lr=0
开始验证!
Epoch 5/10: 100%|██████████| 11/11 [00:52<00:00, 4.76s/it, val_loss=512524608.0000, val_acc=0.5007]
结束验证!
验证loss为:521749024.0000
验证准确率为:0.5010
Epoch 6/10: 100%|█| 43/43 [13:05<00:00, 18.28s/it, train_loss=441831552.0000, train_acc=0.4995, lr=0
开始验证!
Epoch 6/10: 100%|██████████| 11/11 [00:52<00:00, 4.75s/it, val_loss=427103840.0000, val_acc=0.4992]
结束验证!
验证loss为:433481824.0000
验证准确率为:0.4990
Epoch 7/10: 100%|█| 43/43 [13:07<00:00, 18.30s/it, train_loss=376856320.0000, train_acc=0.5020, lr=0
开始验证!
Epoch 7/10: 100%|██████████| 11/11 [00:51<00:00, 4.69s/it, val_loss=366089024.0000, val_acc=0.5022]
结束验证!
验证loss为:370760384.0000
验证准确率为:0.5024
Epoch 8/10: 100%|█| 43/43 [13:00<00:00, 18.16s/it, train_loss=328541408.0000, train_acc=0.5014, lr=0
开始验证!
Epoch 8/10: 100%|██████████| 11/11 [00:52<00:00, 4.74s/it, val_loss=320327872.0000, val_acc=0.5015]
结束验证!
验证loss为:323896160.0000
验证准确率为:0.5017
Epoch 9/10: 100%|█| 43/43 [13:07<00:00, 18.30s/it, train_loss=291207168.0000, train_acc=0.5030, lr=0
开始验证!
Epoch 9/10: 100%|██████████| 11/11 [00:52<00:00, 4.74s/it, val_loss=284735904.0000, val_acc=0.5027]
结束验证!
验证loss为:287550240.0000
验证准确率为:0.5026
Epoch 10/10: 100%|█| 43/43 [13:03<00:00, 18.21s/it, train_loss=261492144.0000, train_acc=0.5038, lr=
开始验证!
Epoch 10/10: 100%|█████████| 11/11 [00:52<00:00, 4.75s/it, val_loss=256262304.0000, val_acc=0.5039]
结束验证!
验证loss为:258538656.0000
验证准确率为:0.5041
华三模拟器Server2 操作 # /etc/config/dhcp
uci set dhcp.eth2dhcp
uci set dhcp.eth2.interfaceeth2
uci set dhcp.eth2.start100
uci set dhcp.eth2.limit150
uci set dhcp.eth2.leasetime12h
# /etc/config/network
uci set network.eth2interface
uci set network.eth2.pr…