Skip to content

About the accuracy of the train phase and the accuracy of the test phase #220

@Dandelion-hi

Description

@Dandelion-hi

I have a doubt is that I found that the accuracy of the data after running train.py was the same as after running test.py. At first I was surprised, but then I looked at the code carefully and found that it seems that the precision of train.py is the test set.So, I would like to ask you all, did Dr. Luo show the results of the test set during the training phase as well? Or my understanding is wrong. Thank you very much for your advice!

The specific code for the training phase is as follows:【trainer.py】

@trainer.on(Events.EPOCH_COMPLETED)
    def log_validation_results(engine):
        if engine.state.epoch % eval_period == 0:
            evaluator.run(val_loader)
            cmc, mAP = evaluator.state.metrics['r1_mAP']
            logger.info("Validation Results - Epoch: {}".format(engine.state.epoch))
            logger.info("mAP: {:.1%}".format(mAP))
            for r in [1, 5, 10]:
                logger.info("CMC curve, Rank-{:<3}:{:.1%}".format(r, cmc[r - 1]))

    trainer.run(train_loader, max_epochs=epochs)

The specific code for the testing phase is as follows:【inference.py】

evaluator.run(val_loader)
    cmc, mAP = evaluator.state.metrics['r1_mAP']
    logger.info('Validation Results')
    logger.info("mAP: {:.1%}".format(mAP))
    for r in [1, 5, 10]:
        logger.info("CMC curve, Rank-{:<3}:{:.1%}".format(r, cmc[r - 1]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions