--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/zVH98Gl9REo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/eb8cbcc7-05a7-4a24-b3a3-f917e25bd5a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result_queue = result_queue
#LOADING CAFFE NETWORK CONFIGS
#omitted for brevity
def run(self):
while True:
image = self.task_queue.get()
prediction = net.predict([img])
return
tasks = multiprocessing.Queue()
results = multiprocessing.Queue()
consumer = Consumer(tasks,results)
consumers.start
while True:
#Grab image from stream
tasks.put(image)
#Do other stuff
--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/zVH98Gl9REo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/a6f0a10f-120b-4d36-8982-7f87405d58ba%40googlegroups.com.
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result_queue = result_queue
#LOADING CAFFE NETWORK CONFIGS
#omitted for brevity
def run(self):
while True:
image = self.task_queue.get()
prediction = net.predict([img])
return
tasks = multiprocessing.Queue()
results = multiprocessing.Queue()
consumer = Consumer(tasks,results)
consumers.start
while True:
#Grab image from stream
tasks.put(image)
#Do other stuff
The program hangs on the line:
prediction = net.predict([img])
It is unable to get past that.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/c6108bf2-be92-4f6f-855f-41fe3cef4d7e%40googlegroups.com.
caffe.set_mode_gpu()
caffe.set_device(0) # set gpu_id 0
class Detection(object):
def __init__():
... # get prototxt and model_path
caffe.set_mode_gpu() caffe.set_device(0) # set gpu_id 0
caffe.set_mode_gpu()
caffe.set_device(0) # set gpu_id 0
self.net.predict(...) # do the prediction code