OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.55k stars 2.19k forks source link

particular operation to run on a CPU or GPU #192

Closed JulianYap closed 5 years ago

JulianYap commented 5 years ago

i using ImageAI for customer perdiction it was working on CPU machine . now i facing issue below after adding in GPU. 1) when concurrent run 2 ImageAI program, one of them will hit CUDNN failed on allocator error 2) How can make it configurable this ImageAI program using CPU and other using GPU.

need help . thank you very much

JulianYap commented 5 years ago

i found the following code

from keras import backend as K cfg = K.tf.ConfigProto() cfg.gpu_options.per_process_gpu_memory = 0.2 K.set_session(K.tf.Session(config=cfg))

training / validation part ....

K.clear_session()

loading another model ....