tensorflow+SSD300+python3

一、准备
搭建SSD框架,下载解压即可

下载pascalvoc数据,自己的数据根据voc格式改写(图片的名称,不用拘泥于6位数字,其他命名也可以)数据集下载点击
解压后不要混合在一个文件夹下
VOCtrainval用来训练,VOCtest用来测试。
VOCtrainval 中JPEGImage文件夹中仅是训练和验证的图片,Main文件夹中仅是trainval.txt, train.txt, val.txt
VOCtest中JPEGImage文件夹中仅是测试图片,Main文件夹中仅是test.txt
自己的文件根据以上文件格式放置图片即可。

自己的数据根据voc格式改写(图片的名称,不用拘泥于6位数字,其他命名也可以)
文件重命名点击

标记自己的数据 ,这个过程枯燥,需要耐心。详情请点击,

生成txt文件,train.txt, trainval.txt, test.txt, val.txt(注意文件路径)
二、生成.tfrecords文件
1、将训练类别修改为和自己一样的
在此目录文件下: SSD-Tensorflow/datasets/pascalvoc_common.py
根据实际情况进行修改
注意:查看训练集的类别和边匡数,可用如下代码:
(1)查看训练集的类别数与边框数代码:

import re
import os
import xml.etree.ElementTree as ET
import copy

class1 = 'Chunqing Li'
'''
class2 = 'bicycle'
class3 = 'bird'
class4 = 'boat'
class5 = 'bottle'
class6 = 'bus'
class7 = 'car'
class8 = 'cat'
class9 = 'chair'
class10 = 'cow'
class11 = 'diningtable'
class12 = 'dog'
class13 = 'horse'
class14 = 'motorbike'
class15 = 'person'
class16 = 'pottedplant'
class17 = 'sheep'
class18 = 'sofa'
class19 = 'train'
class20 = 'tvmonitor'
'''

annotation_folder = '/home/xiaomingming/feiqi/VOC2007/Annotations/'  # 改为自己标签文件夹的路径
list = os.listdir(annotation_folder)


def file_name(file_dir):
    L = []
    f = open('/home/xiaomingming/feiqi/VOC2007/ImageSets/Main/trainval.txt', 'r')
    for lin in f.readlines():
        lin=annotation_folder+lin.rstrip('\n')+'.xml'
        #print(lin)
        L.append(copy.copy(lin))
    return L


total_number1 = 0
'''
total_number2 = 0
total_number3 = 0
total_number4 = 0
total_number5 = 0
total_number6 = 0
total_number7 = 0
total_number8 = 0
total_number9 = 0
total_number10 = 0
total_number11 = 0
total_number12 = 0
total_number13 = 0
total_number14 = 0
total_number15 = 0
total_number16 = 0
total_number17 = 0
total_number18 = 0
total_number19 = 0
total_number20 = 0'''
total = 0
total_pic = 0

pic_num1 = 0
'''
pic_num2 = 0
pic_num3 = 0
pic_num4 = 0
pic_num5 = 0
pic_num6 = 0
pic_num7 = 0
pic_num8 = 0
pic_num9 = 0
pic_num10 = 0
pic_num11 = 0
pic_num12 = 0
pic_num13 = 0
pic_num14 = 0
pic_num15 = 0
pic_num16 = 0
pic_num17 = 0
pic_num18 = 0
pic_num19 = 0
pic_num20 = 0'''

flag1 = 0
'''
flag2 = 0
flag3 = 0
flag4 = 0
flag5 = 0
flag6 = 0
flag7 = 0
flag8 = 0
flag9 = 0
flag10 = 0
flag11 = 0
flag12 = 0
flag13 = 0
flag14 = 0
flag15 = 0
flag16 = 0
flag17 = 0
flag18 = 0
flag19 = 0
flag20 = 0'''

xml_dirs = file_name(annotation_folder)

for i in range(0, len(xml_dirs)):
    print(xml_dirs[i])
    # path = os.path.join(annotation_folder,list[i])
    # print(path)

    annotation_file = open(xml_dirs[i]).read()

    root = ET.fromstring(annotation_file)
    # tree = ET.parse(annotation_file)
    # root = tree.getroot()

    total_pic = total_pic + 1
    for obj in root.findall('object'):
        label = obj.find('name').text
        if label == class1:
            total_number1 = total_number1 + 1
            flag1 = 1
            total = total + 1
        # print("bounding box number:", total_number1)
        '''
        if label == class2:
            total_number2 = total_number2 + 1
            flag2 = 1
            total = total + 1
        if label == class3:
            total_number3 = total_number3 + 1
            flag3 = 1
            total = total + 1
        if label == class4:
            total_number4 = total_number4 + 1
            flag4 = 1
            total = total + 1
        if label == class5:
            total_number5 = total_number5 + 1
            flag5 = 1
            total = total + 1
        if label == class6:
            total_number6 = total_number6 + 1
            flag6 = 1
            total = total + 1
        if label == class7:
            total_number7 = total_number7 + 1
            flag7 = 1
            total = total + 1
        if label == class8:
            total_number8 = total_number8 + 1
            flag8 = 1
            total = total + 1
        if label == class9:
            total_number9 = total_number9 + 1
            flag9 = 1
            total = total + 1
        if label == class10:
            total_number10 = total_number10 + 1
            flag10 = 1
            total = total + 1
        if label == class11:
            total_number11 = total_number11 + 1
            flag11 = 1
            total = total + 1
        if label == class12:
            total_number12 = total_number12 + 1
            flag12 = 1
            total = total + 1
        if label == class13:
            total_number13 = total_number13 + 1
            flag13 = 1
            total = total + 1
        if label == class14:
            total_number14 = total_number14 + 1
            flag14 = 1
            total = total + 1
        if label == class15:
            total_number15 = total_number15 + 1
            flag15 = 1
            total = total + 1
        if label == class16:
            total_number16 = total_number16 + 1
            flag16 = 1
            total = total + 1
        if label == class17:
            total_number17 = total_number17 + 1
            flag17 = 1
            total = total + 1
        if label == class18:
            total_number18 = total_number18 + 1
            flag18 = 1
            total = total + 1
        if label == class19:
            total_number19 = total_number19 + 1
            flag19 = 1
            total = total + 1
        if label == class20:
            total_number20 = total_number20 + 1
            flag20 = 1
            total = total + 1'''

    if flag1 == 1:
        pic_num1 = pic_num1 + 1
        # print("pic number:", pic_num1)
        flag1 = 0
        '''
    if flag2 == 1:
        pic_num2 = pic_num2 + 1
        flag2 = 0
    if flag3 == 1:
        pic_num3 = pic_num3 + 1
        flag3 = 0
    if flag4 == 1:
        pic_num4 = pic_num4 + 1
        flag4 = 0
    if flag5 == 1:
        pic_num5 = pic_num5 + 1
        flag5 = 0
    if flag6 == 1:
        pic_num6 = pic_num6 + 1
        flag6 = 0
    if flag7 == 1:
        pic_num7 = pic_num7 + 1
        flag7 = 0
    if flag8 == 1:
        pic_num8 = pic_num8 + 1
        flag8 = 0
    if flag9 == 1:
        pic_num9 = pic_num9 + 1
        flag9 = 0
    if flag10 == 1:
        pic_num10 = pic_num10 + 1
        flag10 = 0
    if flag11 == 1:
        pic_num11 = pic_num11 + 1
        flag11 = 0
    if flag12 == 1:
        pic_num12 = pic_num12 + 1
        flag12 = 0
    if flag13 == 1:
        pic_num13 = pic_num13 + 1
        flag13 = 0
    if flag14 == 1:
        pic_num14 = pic_num14 + 1
        flag14 = 0
    if flag15 == 1:
        pic_num15 = pic_num15 + 1
        flag15 = 0
    if flag16 == 1:
        pic_num16 = pic_num16 + 1
        flag16 = 0
    if flag17 == 1:
        pic_num17 = pic_num17 + 1
        flag17 = 0
    if flag18 == 1:
        pic_num18 = pic_num18 + 1
        flag18 = 0
    if flag19 == 1:
        pic_num19 = pic_num19 + 1
        flag19 = 0
    if flag20 == 1:
        pic_num20 = pic_num20 + 1
        flag20 = 0'''

print(class1, pic_num1, total_number1)
'''
print(class2, pic_num2, total_number2)
print(class3, pic_num3, total_number3)
print(class4, pic_num4, total_number4)
print(class5, pic_num5, total_number5)
print(class6, pic_num6, total_number6)
print(class7, pic_num7, total_number7)
print(class8, pic_num8, total_number8)
print(class9, pic_num9, total_number9)
print(class10, pic_num10, total_number10)
print(class11, pic_num11, total_number11)
print(class12, pic_num12, total_number12)
print(class13, pic_num13, total_number13)
print(class14, pic_num14, total_number14)
print(class15, pic_num15, total_number15)
print(class16, pic_num16, total_number16)
print(class17, pic_num17, total_number17)
print(class18, pic_num18, total_number18)
print(class19, pic_num19, total_number19)
print(class20, pic_num20, total_number20)'''

print("total", total_pic, total)

(2)查看测试集的类别数与边框数代码:

import re
import os
import xml.etree.ElementTree as ET
import copy

class1 = 'Chunqing Li'
'''
class2 = 'bicycle'
class3 = 'bird'
class4 = 'boat'
class5 = 'bottle'
class6 = 'bus'
class7 = 'car'
class8 = 'cat'
class9 = 'chair'
class10 = 'cow'
class11 = 'diningtable'
class12 = 'dog'
class13 = 'horse'
class14 = 'motorbike'
class15 = 'person'
class16 = 'pottedplant'
class17 = 'sheep'
class18 = 'sofa'
class19 = 'train'
class20 = 'tvmonitor'
'''
annotation_folder = '/home/xiaomingming/feiqi/VOC2007/Annotations/'  # 改为自己标签文件夹的路径
list = os.listdir(annotation_folder)


def file_name(file_dir):
    L = []
    f = open('/home/xiaomingming/feiqi/VOC2007/ImageSets/Main/test.txt', 'r')
    for lin in f.readlines():
        lin=annotation_folder+lin.rstrip('\n')+'.xml'
        #print(lin)
        L.append(copy.copy(lin))
    return L


total_number1 = 0
'''
total_number2 = 0
total_number3 = 0
total_number4 = 0
total_number5 = 0
total_number6 = 0
total_number7 = 0
total_number8 = 0
total_number9 = 0
total_number10 = 0
total_number11 = 0
total_number12 = 0
total_number13 = 0
total_number14 = 0
total_number15 = 0
total_number16 = 0
total_number17 = 0
total_number18 = 0
total_number19 = 0
total_number20 = 0'''
total = 0
total_pic = 0

pic_num1 = 0
'''
pic_num2 = 0
pic_num3 = 0
pic_num4 = 0
pic_num5 = 0
pic_num6 = 0
pic_num7 = 0
pic_num8 = 0
pic_num9 = 0
pic_num10 = 0
pic_num11 = 0
pic_num12 = 0
pic_num13 = 0
pic_num14 = 0
pic_num15 = 0
pic_num16 = 0
pic_num17 = 0
pic_num18 = 0
pic_num19 = 0
pic_num20 = 0'''

flag1 = 0
'''
flag2 = 0
flag3 = 0
flag4 = 0
flag5 = 0
flag6 = 0
flag7 = 0
flag8 = 0
flag9 = 0
flag10 = 0
flag11 = 0
flag12 = 0
flag13 = 0
flag14 = 0
flag15 = 0
flag16 = 0
flag17 = 0
flag18 = 0
flag19 = 0
flag20 = 0'''

xml_dirs = file_name(annotation_folder)

for i in range(0, len(xml_dirs)):
    print(xml_dirs[i])
    # path = os.path.join(annotation_folder,list[i])
    # print(path)

    annotation_file = open(xml_dirs[i]).read()

    root = ET.fromstring(annotation_file)
    # tree = ET.parse(annotation_file)
    # root = tree.getroot()

    total_pic = total_pic + 1
    for obj in root.findall('object'):
        label = obj.find('name').text
        if label == class1:
            total_number1 = total_number1 + 1
            flag1 = 1
            total = total + 1
        # print("bounding box number:", total_number1)
        '''
        if label == class2:
            total_number2 = total_number2 + 1
            flag2 = 1
            total = total + 1
        if label == class3:
            total_number3 = total_number3 + 1
            flag3 = 1
            total = total + 1
        if label == class4:
            total_number4 = total_number4 + 1
            flag4 = 1
            total = total + 1
        if label == class5:
            total_number5 = total_number5 + 1
            flag5 = 1
            total = total + 1
        if label == class6:
            total_number6 = total_number6 + 1
            flag6 = 1
            total = total + 1
        if label == class7:
            total_number7 = total_number7 + 1
            flag7 = 1
            total = total + 1
        if label == class8:
            total_number8 = total_number8 + 1
            flag8 = 1
            total = total + 1
        if label == class9:
            total_number9 = total_number9 + 1
            flag9 = 1
            total = total + 1
        if label == class10:
            total_number10 = total_number10 + 1
            flag10 = 1
            total = total + 1
        if label == class11:
            total_number11 = total_number11 + 1
            flag11 = 1
            total = total + 1
        if label == class12:
            total_number12 = total_number12 + 1
            flag12 = 1
            total = total + 1
        if label == class13:
            total_number13 = total_number13 + 1
            flag13 = 1
            total = total + 1
        if label == class14:
            total_number14 = total_number14 + 1
            flag14 = 1
            total = total + 1
        if label == class15:
            total_number15 = total_number15 + 1
            flag15 = 1
            total = total + 1
        if label == class16:
            total_number16 = total_number16 + 1
            flag16 = 1
            total = total + 1
        if label == class17:
            total_number17 = total_number17 + 1
            flag17 = 1
            total = total + 1
        if label == class18:
            total_number18 = total_number18 + 1
            flag18 = 1
            total = total + 1
        if label == class19:
            total_number19 = total_number19 + 1
            flag19 = 1
            total = total + 1
        if label == class20:
            total_number20 = total_number20 + 1
            flag20 = 1
            total = total + 1'''

    if flag1 == 1:
        pic_num1 = pic_num1 + 1
        # print("pic number:", pic_num1)
        flag1 = 0
        '''
    if flag2 == 1:
        pic_num2 = pic_num2 + 1
        flag2 = 0
    if flag3 == 1:
        pic_num3 = pic_num3 + 1
        flag3 = 0
    if flag4 == 1:
        pic_num4 = pic_num4 + 1
        flag4 = 0
    if flag5 == 1:
        pic_num5 = pic_num5 + 1
        flag5 = 0
    if flag6 == 1:
        pic_num6 = pic_num6 + 1
        flag6 = 0
    if flag7 == 1:
        pic_num7 = pic_num7 + 1
        flag7 = 0
    if flag8 == 1:
        pic_num8 = pic_num8 + 1
        flag8 = 0
    if flag9 == 1:
        pic_num9 = pic_num9 + 1
        flag9 = 0
    if flag10 == 1:
        pic_num10 = pic_num10 + 1
        flag10 = 0
    if flag11 == 1:
        pic_num11 = pic_num11 + 1
        flag11 = 0
    if flag12 == 1:
        pic_num12 = pic_num12 + 1
        flag12 = 0
    if flag13 == 1:
        pic_num13 = pic_num13 + 1
        flag13 = 0
    if flag14 == 1:
        pic_num14 = pic_num14 + 1
        flag14 = 0
    if flag15 == 1:
        pic_num15 = pic_num15 + 1
        flag15 = 0
    if flag16 == 1:
        pic_num16 = pic_num16 + 1
        flag16 = 0
    if flag17 == 1:
        pic_num17 = pic_num17 + 1
        flag17 = 0
    if flag18 == 1:
        pic_num18 = pic_num18 + 1
        flag18 = 0
    if flag19 == 1:
        pic_num19 = pic_num19 + 1
        flag19 = 0
    if flag20 == 1:
        pic_num20 = pic_num20 + 1
        flag20 = 0'''

print(class1, pic_num1, total_number1)
'''
print(class2, pic_num2, total_number2)
print(class3, pic_num3, total_number3)
print(class4, pic_num4, total_number4)
print(class5, pic_num5, total_number5)
print(class6, pic_num6, total_number6)
print(class7, pic_num7, total_number7)
print(class8, pic_num8, total_number8)
print(class9, pic_num9, total_number9)
print(class10, pic_num10, total_number10)
print(class11, pic_num11, total_number11)
print(class12, pic_num12, total_number12)
print(class13, pic_num13, total_number13)
print(class14, pic_num14, total_number14)
print(class15, pic_num15, total_number15)
print(class16, pic_num16, total_number16)
print(class17, pic_num17, total_number17)
print(class18, pic_num18, total_number18)
print(class19, pic_num19, total_number19)
print(class20, pic_num20, total_number20)'''

print("total", total_pic, total)

注释原始的标签,添加自己的标签

VOC_LABELS = {
‘none’: (0, ‘Background’),
‘aeroplane’: (1, ‘Vehicle’),
‘bicycle’: (2, ‘Vehicle’),
‘bird’: (3, ‘Animal’),
‘boat’: (4, ‘Vehicle’),
… …
‘Person’: (15, ‘Person’),
‘pottedplant’: (16, ‘Indoor’),
‘sheep’: (17, ‘Animal’),
‘sofa’: (18, ‘Indoor’),
‘train’: (19, ‘Vehicle’),
‘tvmonitor’: (20, ‘Indoor’),
}

2、将图像数据转换为tfrecods格式
SSD-Tensorflow/datasets/pascalvoc_to_tfrecords.py。
更改文件的 83 行:image_data = tf.gfile.FastGFile(filename, ‘rb’).read();
如果你的图片不是.jpg格式,修改图片类型;
更改文件的 67 行,SAMPLES_PER_FILES = 500(自定义)意为:几个.xml转为一个tfrecords

3、生成.tfrecords文件
打开tf_convert_data.py文件,依次点击:run、Edit Configuration,在Parameters中填入以下内容,再运行tf_convert_data.py文件,在面板中得到成功信息,可以在tfrecords_文件夹下看到生成的.tfrecords文件;
–dataset_name=pascalvoc
–dataset_dir=./VOC2007/
–output_name=voc_2007_train
–output_dir=./tfrecords_
三、训练模型修改
1、datasets/pascalvoc_2007.py修改训练数据shape:
根据自己训练数据修改:NUM_CLASSES = 类别数;
TRAIN_STATISTICS = {
‘none’: (0, 0),
‘aeroplane’: (238, 306), #238图片数, 306目标总数
‘bicycle’: (243, 353),
‘bird’: (330, 486),
‘boat’: (181, 290),
… …
‘sheep’: (96, 257),
‘sofa’: (229, 248),
‘train’: (261, 297),
‘tvmonitor’: (256, 324),
‘total’: (5011, 12608), #5011 为训练的图片书,12608为目标总数
}
TEST_STATISTICS = {
‘none’: (0, 0),
‘aeroplane’: (1, 1),
‘bicycle’: (1, 1),
‘bird’: (1, 1),
… …
‘sheep’: (1, 1),
‘sofa’: (1, 1),
‘train’: (1, 1),
‘tvmonitor’: (1, 1),
‘total’: (20, 20),
}
SPLITS_TO_SIZES = {
‘train’: 5011, # 训练数据量
‘test’: 4952, # 测试数据量
}
SPLITS_TO_STATISTICS = {
‘train’: TRAIN_STATISTICS,
‘test’: TEST_STATISTICS,
}
NUM_CLASSES = 20 # 类别,根据自己数据的实际类别修改(不包含背景)

2、nets/ssd_vgg_300.py 修改类别个数,根据自己训练类别数修改96 和97行:等于类别数+1;
img_shape=(300, 300),
num_classes=21, #根据自己的数据修改为类别+1
no_annotation_label=21, #根据自己的数据修改为类别+1

3、eval_ssd_network.py修改类别个数,修改66行的类别个数:等于类别数+1;
tf.app.flags.DEFINE_integer(
‘num_classes’, 21, ‘Number of classes to use in the dataset.’)

4、train_ssd_network.py
修改 27行的数据格式,改为’NHWC’;
修改135行的类别个数:等于类别数+1;
修改 56行—66行是关于模型运行保存的参数;
修改 154行的最大训练步数,将None(训练会无限进行)改为比如50000。
四、训练
方案1 从vgg开始训练其中某些层的参数:

ssd_300_vgg中的300是指把图片归一化为 300*300,所以如果要用ssd_512_vgg来fine-tune的话,就只需要重新训练受图片分辨率影响的层即可。

通过加载预训练好的vgg16模型,进行训练

通过 checkpoint_exclude_scopes 指定哪些层的参数不需要从vgg16模型里面加载进来

通过 trainable_scopes指定哪些层的参数是需要训练的,未指定的参数保持不变,若注释掉此命令,所有的参数均需要训练

DATASET_DIR=./tfrecords_/ # 数据存放路径
TRAIN_DIR=./train_model/ # 训练生成模型的存放路径
CHECKPOINT_PATH=./checkpoints/vgg_16.ckpt # 加载预训练模型的路径

python3 …/train_ssd_network.py \
–train_dir=KaTeX parse error: Expected 'EOF', got '#' at position 28: …\ #̲ 训练生成模型的存放路径 …{DATASET_DIR} \ # 数据存放路径
–dataset_name=pascalvoc_2007 \ # 数据名的前缀
–dataset_split_name=train \
–model_name=ssd_300_vgg \ # 加载的模型的名字
–checkpoint_path=${CHECKPOINT_PATH} \ # 所加载模型的路径
–checkpoint_model_scope=vgg_16 \ # 所加载模型里面的作用域名
–checkpoint_exclude_scopes=ssd_300_vgg/conv6,ssd_300_vgg/conv7,ssd_300_vgg/block8,ssd_300_vgg/block9,ssd_300_vgg/block10,ssd_300_vgg/block11,ssd_300_vgg/block4_box,ssd_300_vgg/block7_box,ssd_300_vgg/block8_box,ssd_300_vgg/block9_box,ssd_300_vgg/block10_box,ssd_300_vgg/block11_box \
–trainable_scopes=ssd_300_vgg/conv6,ssd_300_vgg/conv7,ssd_300_vgg/block8,ssd_300_vgg/block9,ssd_300_vgg/block10,ssd_300_vgg/block11,ssd_300_vgg/block4_box,ssd_300_vgg/block7_box,ssd_300_vgg/block8_box,ssd_300_vgg/block9_box,ssd_300_vgg/block10_box,ssd_300_vgg/block11_box \
–save_summaries_secs=60 \ # 每60s保存一下日志
–save_interval_secs=600 \ # 每600s保存一下模型
–weight_decay=0.0005 \ # 正则化的权值衰减的系数
–optimizer=adam \ # 选取的最优化函数
–learning_rate=0.001 \ # 学习率
–learning_rate_decay_factor=0.94 \ # 学习率的衰减因子
–batch_size=24 \ # 可以小一点,不然可能会报错(显存不够用)
–gpu_memory_fraction=0.9 # 指定占用gpu内存的百分比

方案2:从头开始训练自己的模型

#注释掉如下参数:
#CHECKPOINT_PATH=./checkpoints/vgg_16.ckpt 不提供初始化模型,让模型自己随机初始化权重,从头训练
#–checkpoint_path=KaTeX parse error: Expected 'EOF', got '#' at position 19: …ECKPOINT_PATH} #̲--checkpoint_pa…{CHECKPOINT_PATH}
#–checkpoint_model_scope=ssd_512_vgg
#–checkpoint_exclude_scopes=ssd_300_vgg/block10…
#–trainable_scopes=ssd_300_vgg/conv6…

#/bin/bash
DATASET_DIR=./tfrecords_/ # 数据存放路径
TRAIN_DIR=./train_model/ # 训练生成模型的存放路径

CUDA_VISIBLE_DEVICES=0 python3 ./train_ssd_network.py
–train_dir=KaTeX parse error: Expected 'EOF', got '\ ' at position 13: {TRAIN_DIR} \̲ ̲ --dataset_dir…{DATASET_DIR}
–dataset_name=pascalvoc_2007
–dataset_split_name=train
–model_name=ssd_300_vgg
–save_summaries_secs=600
–save_interval_secs=600
–optimizer=adam
–learning_rate_decay_factor=0.94
–batch_size=32
–gpu_memory_fraction=0.9

五、测试验证
1、生成 .tfrecords文件。将测试图片转换为tfrecords
#!/bin/bash
DATASET_DIR=./VOC2007/test_images/ # 测试图片目录(存放测试的图片)
OUTPUT_DIR=./tfrecords_/tfrecords/ # 测试图片的 .tfrecords文件
python3 ./tf_convert_data.py
–dataset_name=pascalvoc
–dataset_dir=KaTeX parse error: Expected 'EOF', got '\ ' at position 15: {DATASET_DIR} \̲ ̲ --output…{OUTPUT_DIR}
2、运行测试
#!/bin/bash
DATASET_DIR=./tfrecords_/tfrecords/
EVAL_DIR=./ssd_eval_log/
CHECKPOINT_PATH=./train_model/model.ckpt-5000

python3 ./eval_ssd_network.py
–eval_dir=KaTeX parse error: Expected 'EOF', got '\ ' at position 12: {EVAL_DIR} \̲ ̲ --datase…{DATASET_DIR}
–dataset_name=pascalvoc_2007
–dataset_split_name=test
–model_name=ssd_300_vgg
–checkpoint_path=${CHECKPOINT_PATH}
–batch_size=1

3、使用 notebooksssd_notebook.ipynb来查看模型标注的图片。详情请点击
修改ckpt_filename = “路径/自己训练的权重文件”
修改自己图片所在的路径,或者将需要测试的图片放入
参考:https://blog.csdn.net/wsp_1138886114/article/details/85031094

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员阿明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值