Skip to content

Instantly share code, notes, and snippets.

@jdevoldere
jdevoldere / mp_batch_gen.py
Created July 6, 2020 17:10
Multiprocessing batch generator in Keras
import multiprocessing
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense, Input, LSTM
from tensorflow.keras.models import Model
import time
def batch_generator(queue):
while True: