Skip to content

Instantly share code, notes, and snippets.

name: "vgg16_sbdd"
layer {
name: "data"
type: "Python"
top: "data"
top: "label"
top: "inter"
python_param {
module: "voc_layers"
layer: "SBDDInterSegDataLayer"
@peiyunh
peiyunh / batch_run.py
Created September 27, 2018 01:38
Run commands in parallel with a limited pool
num_proc = 8
procs = []
running = []
for command in commands:
while (sum(running) >= num_proc):
for i, proc in enumerate(procs):
running[i] = (proc.poll() is None)
time.sleep(1.0)
procs.append(subprocess.Popen(command, shell=True))