Enable saved model restoration using just a .pb file.
PiperOrigin-RevId: 338342231 Change-Id: Idfb9a0692fb414d8bc153caf031fe9987fa83b30
This commit is contained in:
parent
7912c72005
commit
47f21101fa
@ -404,10 +404,12 @@ Status RestoreSession(const RunOptions& run_options,
|
|||||||
const uint64 read_start_microseconds = Env::Default()->NowMicros();
|
const uint64 read_start_microseconds = Env::Default()->NowMicros();
|
||||||
std::vector<AssetFileDef> asset_file_defs;
|
std::vector<AssetFileDef> asset_file_defs;
|
||||||
TF_RETURN_IF_ERROR(internal::GetAssetFileDefs(meta_graph, &asset_file_defs));
|
TF_RETURN_IF_ERROR(internal::GetAssetFileDefs(meta_graph, &asset_file_defs));
|
||||||
|
if (meta_graph.has_saver_def()) {
|
||||||
TF_RETURN_IF_ERROR(RunRestore(run_options, export_dir,
|
TF_RETURN_IF_ERROR(RunRestore(run_options, export_dir,
|
||||||
meta_graph.saver_def().restore_op_name(),
|
meta_graph.saver_def().restore_op_name(),
|
||||||
meta_graph.saver_def().filename_tensor_name(),
|
meta_graph.saver_def().filename_tensor_name(),
|
||||||
asset_file_defs, session->get()));
|
asset_file_defs, session->get()));
|
||||||
|
}
|
||||||
// Record walltime spent in restoring graph from disk, but postpone metric
|
// Record walltime spent in restoring graph from disk, but postpone metric
|
||||||
// increments until graph init finishes.
|
// increments until graph init finishes.
|
||||||
const uint64 restore_graph_walltime =
|
const uint64 restore_graph_walltime =
|
||||||
|
Loading…
Reference in New Issue
Block a user