How to use evaluation_loop with train_loop in tf-slim

前端 未结 3 2005
长情又很酷
长情又很酷 2021-02-04 10:57

I\'m trying to implement a few different models and train them on CIFAR-10, and I want to use TF-slim to do this. It looks like TF-slim has two main loops that are useful during

3条回答
  •  不知归路
    2021-02-04 11:51

    1. evaluation_loop is meant to be used (as you are currently using it) with a single directory. If you want to be more efficient, you could use slim.evaluation.evaluate_once and add the appropriate logic for swapping directories as you find appropriate.

    2. You can do this by overriding the slim.learning.train(..., train_step_fn) argument. This argument replaces the 'train_step' function with a custom function. Here, you can supply custom training function which returns the 'total_loss' and 'should_stop' values as you see fit.

    3. Your workflow looks great, this is probably the most common workflow for learning/eval using TF-Slim.

提交回复
热议问题