使用Tensorflow的Obeject Detection API训练模型时会发现同一信息会打印两次,如下图所示:

第一种方法:
问题可能出现在这里:
tensorflow/models/research/object_detection/utils/variables_helper.py
打开该文件,将以下代码注释掉即可:
# else:
# logging.warning('Variable [%s] not available in checkpoint',
# variable_name)
此时再训练,问题已解决:

二、第二种方法:
同样,打开上述文件,然后按照下述方式修改import:
import re
import tensorflow as tf
from tensorflow import logging as logging
from tensorflow.python.ops import variables as tf_variables
slim = tf.contrib.slim
也可以解决问题!
本文介绍了解决使用TensorFlow的ObjectDetectionAPI训练模型时,同一信息重复打印两次的问题。通过修改variables_helper.py文件中的代码或调整import语句,可以有效避免这一现象,提升训练过程的可读性。
363

被折叠的 条评论
为什么被折叠?



