From 9ca24ce6298549e0b2a613b29d8a42d9fe3fb6d7 Mon Sep 17 00:00:00 2001
From: fufufukakaka <demonstrundum@gmail.com>
Date: Mon, 25 Jul 2022 15:55:00 +0900
Subject: [PATCH] insert eval_collector.data_collect when evaluate from
 checkpoint

---
 docs/source/user_guide/usage/use_modules.rst | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/source/user_guide/usage/use_modules.rst b/docs/source/user_guide/usage/use_modules.rst
index 622d019f9..b98c29e10 100644
--- a/docs/source/user_guide/usage/use_modules.rst
+++ b/docs/source/user_guide/usage/use_modules.rst
@@ -196,8 +196,11 @@ In this example, we present how to test a model based on the previous saved para
         # trainer loading and initialization
         trainer = get_trainer(config['MODEL_TYPE'], config['model'])(config, model)
 
+        # When calculate ItemCoverage metrics, we need to run this code for set item_nums in eval_collector.
+        trainer.eval_collector.data_collect(train_data)
+
         # model evaluation
         checkpoint_file = 'checkpoint.pth'
         test_result = trainer.evaluate(test_data, model_file=checkpoint_file)
         print(test_result)
-        ...
\ No newline at end of file
+        ...