1

TF-slim inceptionv3 从零开始训练

我使用 slim/train_image_classifier.py 在我自己的数据集上训练 inception_v3 模型: python train_image_classifier.py --train_dir=${TRAIN_DIR} --dataset_name=mydataset --dataset_split_name=train --dataset_dir=${DATASET_DIR} --model_name =inception_v3 --num_clones=2

如图所示,损失曲线很奇怪,它是一条线性下降的直线,带有一点凹凸部分。 在此处输入图像描述

以下是最后的输出,每 20 或 30 步损失减少 0.0001:</p>

INFO:tensorflow:global step 34590: loss = 0.5359 (1.17 sec/step)
INFO:tensorflow:global step 34600: loss = 0.5358 (1.15 sec/step)
INFO:tensorflow:global step 34590: loss = 0.5359 (1.17 sec/step)
INFO:tensorflow:global step 34600: loss = 0.5358 (1.15 sec/step)
INFO:tensorflow:global step 34610: loss = 0.5358 (1.17 sec/step)
INFO:tensorflow:global step 34620: loss = 0.5357 (1.12 sec/step)
INFO:tensorflow:global step 34630: loss = 0.5357 (1.16 sec/step)
INFO:tensorflow:global step 34640: loss = 0.5356 (1.16 sec/step)
INFO:tensorflow:global step 34650: loss = 0.5356 (1.16 sec/step)
INFO:tensorflow:global step 34660: loss = 0.5355 (1.15 sec/step)
INFO:tensorflow:global step 34670: loss = 0.5355 (1.15 sec/step)
INFO:tensorflow:global step 34680: loss = 0.5355 (1.18 sec/step)
INFO:tensorflow:global step 34690: loss = 0.5354 (1.17 sec/step)
INFO:tensorflow:global step 34700: loss = 0.5354 (1.15 sec/step)
INFO:tensorflow:global step 34710: loss = 0.5353 (1.15 sec/step)
INFO:tensorflow:global step 34720: loss = 0.5353 (2.25 sec/step)
INFO:tensorflow:global step 34730: loss = 0.5353 (2.22 sec/step)
INFO:tensorflow:global step 34740: loss = 0.5352 (1.16 sec/step)
INFO:tensorflow:global step 34750: loss = 0.5352 (1.16 sec/step)
INFO:tensorflow:global step 34760: loss = 0.5351 (1.18 sec/step)
INFO:tensorflow:global step 34770: loss = 0.5351 (1.15 sec/step)
INFO:tensorflow:global step 34780: loss = 0.5350 (1.17 sec/step)
INFO:tensorflow:global step 34790: loss = 0.5350 (1.15 sec/step)
INFO:tensorflow:global step 34800: loss = 0.5349 (1.12 sec/step)
INFO:tensorflow:global step 34810: loss = 0.5349 (1.12 sec/step)
INFO:tensorflow:global step 34820: loss = 0.5349 (1.16 sec/step)
INFO:tensorflow:global step 34830: loss = 0.5348 (1.16 sec/step)
INFO:tensorflow:global step 34840: loss = 0.5348 (1.18 sec/step)
INFO:tensorflow:global step 34850: loss = 0.5347 (1.12 sec/step)
INFO:tensorflow:global step 34860: loss = 0.5347 (1.12 sec/step)
INFO:tensorflow:global step 34870: loss = 0.5347 (1.18 sec/step)
INFO:tensorflow:global step 34880: loss = 0.5346 (1.13 sec/step)
INFO:tensorflow:global step 34890: loss = 0.5346 (1.18 sec/step)
INFO:tensorflow:global step 34900: loss = 0.5345 (1.16 sec/step)
INFO:tensorflow:global step 34910: loss = 0.5345 (1.15 sec/step)
INFO:tensorflow:global step 34920: loss = 0.5344 (1.17 sec/step)
INFO:tensorflow:global step 34930: loss = 0.5344 (1.14 sec/step)
INFO:tensorflow:global step 34940: loss = 0.5344 (1.15 sec/step)
INFO:tensorflow:global step 34950: loss = 0.5343 (1.14 sec/step)
INFO:tensorflow:global step 34960: loss = 0.5343 (1.17 sec/step)  

mydataset.py 与flowers.py 相同,除了:

SPLITS_TO_SIZES = {'train': 18000000, 'validation': 400000}
 _NUM_CLASSES = 4

正常吗?谢谢你的帮助。

4

1 回答 1

0

您正在绘制训练中 n 步后的总损失图(如果您使用 tf.contrib.slim 训练方法,可能是 number_of_steps),而记录的损失是每 10 步。希望这可以帮助!

于 2017-11-28T23:34:53.213 回答