Пример #1
0
    label=DATASET,
    item='train_accuracy',
)

# ========== save model ==========
modelpath = path_cls.make_model_path(MAINNAME + '-' + DATASET + '.h5')
nfunc.save_best_generator_model(net_cls=net_cls,
                                path_cls=path_cls,
                                path=modelpath)

# ========== 生成速度計測 ==========
gen_cls = ImageGenerator(Generator_model=modelpath,
                         model_h=IMAGE_HEIGHT,
                         model_w=IMAGE_WIDTH,
                         fin_activate=FIN_ACTIVATE,
                         padding=net_cls.get_padding())
gen_cls.run(img_path=GENERATOR_TEST_PATH,
            out_path=GENERATOR_OUTPATH,
            time_out_path=path_cls.make_csv_path('Generator_time.csv'))
gen_cls = ImageGenerator(Generator_model=modelpath,
                         model_h=IMAGE_HEIGHT,
                         model_w=IMAGE_WIDTH,
                         fin_activate=FIN_ACTIVATE,
                         padding=net_cls.get_padding(),
                         use_gpu=False)
gen_cls.run(
    img_path=GENERATOR_TEST_PATH,
    out_path=GENERATOR_OUTPATH,
    time_out_path=path_cls.make_csv_path('Generator_time_cpu.csv'),
)