MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / restore_fn

Method restore_fn

tensorflow/python/ops/work_queue_test.py:247–264  ·  view source on GitHub ↗
(save_path)

Source from the content-addressed store, hash-verified

245 # pylint: disable=not-callable
246 incompatible_saver.save(sess, os.path.join(save_path, 'test_nockpt'))
247 def restore_fn(save_path):
248 server = server_lib.Server.create_local_server()
249 with ops.Graph().as_default():
250 with ops.device('/cpu:0'):
251 training_util.get_or_create_global_step()
252 work_queue = WorkQueue(
253 [b"fast", b"fox", b"jumps", b"over", b"lazy", b"dog"],
254 num_epochs=3, name='wq_restore_nothing')
255 local_queue = work_queue.input_producer()
256 dequeue = local_queue.dequeue()
257 default_saver = saver.Saver(
258 builder=PartialRestoreSaverBuilder(checkpoint_dir=save_path))
259 ops.add_to_collection(ops.GraphKeys.SAVERS, default_saver)
260 with monitored_session.MonitoredTrainingSession(
261 master=server.target,
262 checkpoint_dir=save_path) as sess:
263 sess.run(dequeue)
264 logging.info('work queue restored at {}'.format(save_path))
265 restore_proc = Process(target=restore_fn, args=(save_path,))
266 restore_proc.start()
267 restore_proc.join()

Callers

nothing calls this directly

Calls 12

input_producerMethod · 0.95
WorkQueueClass · 0.90
create_local_serverMethod · 0.80
add_to_collectionMethod · 0.80
infoMethod · 0.80
as_defaultMethod · 0.45
GraphMethod · 0.45
deviceMethod · 0.45
dequeueMethod · 0.45
runMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected