【发布时间】:2017-05-23 09:36:48
【问题描述】:
我正在根据此处的代码重新训练 Inception v3 网络:https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#0。 我有一组 200 个标签。每个标签的图像数量从 50 到 15000 不等。重新训练时出现以下错误:
2017-01-08 07:42:09.683263: Step 30: Train accuracy = 6.0%
2017-01-08 07:42:09.683384: Step 30: Cross entropy = 6.297137
2017-01-08 07:42:09.808175: Step 30: Validation accuracy = 0.0%
2017-01-08 07:42:11.083850: Step 40: Train accuracy = 2.0%
2017-01-08 07:42:11.083964: Step 40: Cross entropy = 6.296147
CRITICAL:tensorflow:Label corset has no images in the category validation.
Traceback (most recent call last):
File "tensorflow/examples/image_retraining/retrain.py", line 1012, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tensorflow/examples/image_retraining/retrain.py", line 839, in main
bottleneck_tensor))
File "tensorflow/examples/image_retraining/retrain.py", line 480, in get_random_cached_bottlenecks
bottleneck_tensor)
File "tensorflow/examples/image_retraining/retrain.py", line 388, in get_or_create_bottleneck
bottleneck_dir, category)
File "tensorflow/examples/image_retraining/retrain.py", line 245, in get_bottleneck_path
category) + '.txt'
File "tensorflow/examples/image_retraining/retrain.py", line 221, in get_image_path
mod_index = index % len(category_list)
ZeroDivisionError: integer division or modulo by zero`
在 google 上搜索让我明白,如果图像少于 20 个,则可能会发生此类错误。这可能是因为它们可能没有足够的图像进行验证。但是我至少有 50 张图片。那么为什么我会收到这个错误呢?
【问题讨论】:
标签: image-processing machine-learning tensorflow neural-network conv-neural-network