Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dandelion-hi opened this issue Nov 24, 2022 · 0 comments

Comments

@Dandelion-hi
Copy link

Dandelion-hi commented Nov 24, 2022

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]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant