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

Evaluation with model_main.py not using old checkpoints/don't evaluate choosen dataset #10710

Open
Petros626 opened this issue Jul 16, 2022 · 3 comments
Labels
models:research models that come under research directory type:support

Comments

@Petros626
Copy link

Hello,

I want to evaluate my training and test data and I found several approaches do to that with eval.py and model_main.py.

Now my problem is, that the script begins to train from the beginning and evaluates the test data, even if the the flag --eval_training_data is True. One guess is to change the eval_input_reader in my config file to train.record, but not sure.

Could please someone help me with this, don't want to start from the beginning, if i already have checkpoints...

set CONFIG_FILE=C:\Users\petros.katsoulakos\models2\models-master\research\object_detection\training\ssd_mobilenet_v2_quantized_300x300_coco_custom_aspect_ratios.config

set OUTPUT_DIR=C:\Users\petros.katsoulakos\models2\models-master\research\object_detection\tensorboard_outputs\after_training\eval_train_data

set CHECKPOINT_PATH= C:\Users\petros.katsoulakos\models2\models-master\research\object_detection\training\model.ckpt-200000

python model_main.py --pipeline_config_path=%CONFIG_FILE% --model_dir=%OUTPUT_DIR% --eval_training_data=True --checkpoint_dir=%CHECKPOINT_PATH% --run_once=True

@jvishnuvardhan jvishnuvardhan added the models:research models that come under research directory label Jul 19, 2022
@gadagashwini gadagashwini self-assigned this Jul 20, 2022
@gadagashwini
Copy link

Hi @Petros626,
You can try,
python model_main.py
--pipeline_config_path=%CONFIG_FILE%
--model_dir=%OUTPUT_DIR%
--eval_training_data=True
--checkpoint_dir=%CHECKPOINT_PATH%
--run_once=True

pipeline.config

eval_config: {
  metrics_set: "coco_detection_metrics"
  num_examples:  # no of test images
  num_visualizations:  # no of visualizations for tensorboard
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "/path/to/test-data.record"
  }
  label_map_path: "/path/to/label_map.pbtxt"
  shuffle: true
  num_readers: 1
}

Thank you!

@gadagashwini gadagashwini added the stat:awaiting response Waiting on input from the contributor label Jul 20, 2022
@Petros626
Copy link
Author

Hi @Petros626, You can try, python model_main.py --pipeline_config_path=%CONFIG_FILE% --model_dir=%OUTPUT_DIR% --eval_training_data=True --checkpoint_dir=%CHECKPOINT_PATH% --run_once=True

pipeline.config

eval_config: {
  metrics_set: "coco_detection_metrics"
  num_examples:  # no of test images
  num_visualizations:  # no of visualizations for tensorboard
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "/path/to/test-data.record"
  }
  label_map_path: "/path/to/label_map.pbtxt"
  shuffle: true
  num_readers: 1
}

Thank you!

Hello @gadagashwini the suggested command is the same like mine, so the problem is the last saved checkpoint is not readed, TF will start a new training and the second thing is that i have to force in config file by changing the eval_input_reader to train.record to evaluate on training data, so the flag doesn't working. I expect a right behaviour, by using the model_main.py, but seems, that you have to configure the job, if you don't want to evaluate the test.record (default).

Your changing in the config file is to evaluate of COCO, which makes no sense in my case, because I have 3D-LiDAR data, so I evaluated on my training and test data.

Here are my summaries to the behaviour:
model_main.py:
->only new training and evaluation possible, pure evaluation on train o. test only with new unnecessary(have already checkpoints) possible
->eval_training_data=True doesn't work, must force via config file to eval on train o. test.

eval.py:
->evaluation possible without training (meant for this)
->loads the last checkpoint from training (hoped mode_main.py will too)
-> also here forcing via config file
-> flag doesn't working too

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting on input from the contributor label Jul 21, 2022
@Petros626
Copy link
Author

@gadagashwini any tips?

@gadagashwini gadagashwini removed their assignment Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models:research models that come under research directory type:support
Projects
None yet
Development

No branches or pull requests

3 participants