MCPcopy Create free account
hub / github.com/Duankaiwen/CenterNet / prefetch_data

Function prefetch_data

train.py:37–47  ·  view source on GitHub ↗
(db, queue, sample_data, data_aug)

Source from the content-addressed store, hash-verified

35 return args
36
37def prefetch_data(db, queue, sample_data, data_aug):
38 ind = 0
39 print("start prefetching data...")
40 np.random.seed(os.getpid())
41 while True:
42 try:
43 data, ind = sample_data(db, ind, data_aug=data_aug)
44 queue.put(data)
45 except Exception as e:
46 traceback.print_exc()
47 raise e
48
49def pin_memory(data_queue, pinned_data_queue, sema):
50 while True:

Callers

nothing calls this directly

Calls 1

sample_dataFunction · 0.85

Tested by

no test coverage detected