Open1

ckpt のエクスポート例

    # Set sess configuration
    sess_config = tf.ConfigProto()
    sess_config.gpu_options.per_process_gpu_memory_fraction = CFG.GPU.GPU_MEMORY_FRACTION
    sess_config.gpu_options.allow_growth = CFG.GPU.TF_ALLOW_GROWTH
    sess_config.gpu_options.allocator_type = 'BFC'
    sess_config.allow_soft_placement=True
    sess_config.log_device_placement=True
    sess = tf.Session(config=sess_config)

    print('model.ph_imgs', model.ph_imgs.name)
    for o in model.endpoints.values():
        print('model.endpoints', o.name)

    # model.sess.run(tf.global_variables_initializer())
    tf.saved_model.simple_save(
        model.sess,
        'saved_model',
        inputs={
            'input': model.ph_imgs
        },
        outputs={
            'descs': model.endpoints['descs'],
            'kpts': model.endpoints['kpts'],
            'scores': model.endpoints['scores']
        }
    )
    import sys
    sys.exit(0)
ログインするとコメントできます