adanet
                                
                                 adanet copied to clipboard
                                
                                    adanet copied to clipboard
                            
                            
                            
                        How to import the saved/trained model to test on a testing dataset?
Hi, @cweill I have trained a model on my datasets with NASNet-A as the subnetwork, and have saved some checkpoints. If I want to import the saved model (model.ckpt**) again to test on a testing dataset, what should I do?
@SmallyolkLiu: Did you find the answer to your original question?
@cweill Not yet, I have an more interesting issue instead, that is , if the program suddenly breaks down, how to rerun it based on the saved results previously? For the case of NASNet as a subnetwork, many many training steps (hundreds of thousands) are necessary, it will a problem in the absence of an effective solution to multi-GPU training.
If you want to use the latest checkpoint, just recreate the same adanet.Estimator with the same model_dir. When you call Estimator#predict it will load the variables from the latest checkpoint.
If you want to load a previous checkpoint, there is a checkpoint file created automatically in your model_dir.
It should look something like:
model_checkpoint_path: "model.ckpt-400000"
all_model_checkpoint_paths: "model.ckpt-270000"
all_model_checkpoint_paths: "model.ckpt-280000"
all_model_checkpoint_paths: "model.ckpt-290000"
all_model_checkpoint_paths: "increment.ckpt-3"
all_model_checkpoint_paths: "model.ckpt-300000"
all_model_checkpoint_paths: "model.ckpt-310000"
all_model_checkpoint_paths: "model.ckpt-320000"
all_model_checkpoint_paths: "model.ckpt-330000"
all_model_checkpoint_paths: "model.ckpt-340000"
all_model_checkpoint_paths: "model.ckpt-350000"
all_model_checkpoint_paths: "model.ckpt-360000"
all_model_checkpoint_paths: "model.ckpt-370000"
all_model_checkpoint_paths: "model.ckpt-380000"
all_model_checkpoint_paths: "model.ckpt-390000"
all_model_checkpoint_paths: "model.ckpt-400000"
Just update model_checkpoint_path to point to the checkpoint you want the Estimator to read and continue from.
@cweill Thanks.
My problem is not mainly loading the estimator, actually it is creating it properly and using it I tried to do what is suggested here https://github.com/tensorflow/adanet/issues/22#issuecomment-437567652, but my generator is empty. Can you please explain this the correct approach to make prediction on test data in the tutorial, that will help alot? Big thanks
May be it is simpler if you can tell how to load a saved model?