textgenrnn
textgenrnn copied to clipboard
CUBLAS_STATUS_ALLOC_FAILED
I was getting a lot of CUBLAS_STATUS_ALLOC_FAILED when using my GPU and running even just this 4 line program
from textgenrnn import textgenrnn textgen = textgenrnn() textgen.train_from_file('goodcombined.txt', num_epochs=2) textgen.generate(15)
Luckily this comment from stack overflow had code that was able to resolve it for me. This is how I applied it to textgenrnn.py:
if allow_growth is not None: config = tf.compat.v1.ConfigProto(gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.8)) config.gpu_options.allow_growth = True session = tf.compat.v1.Session(config=config) tf.compat.v1.keras.backend.set_session(session)
I do not know how this works, but it did for me.