smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

Slow detection speed using GPU #265

Open alvinxiii opened 6 years ago

alvinxiii commented 6 years ago

Refer to #61 post. I added the custom code for using a video demo. However, when I run the code. The video is process at an average of 5 fps. Even I added --gpu 0. I tested on picture with both cpu and gpu. The execution time is the same. How to increase the processing speed?

Ellexm commented 6 years ago

I have met the same problem, have you solved it?

dahaigui commented 4 years ago

Refer to #61 post. I added the custom code for using a video demo. However, when I run the code. The video is process at an average of 5 fps. Even I added --gpu 0. I tested on picture with both cpu and gpu. The execution time is the same. How to increase the processing speed?

Maybe you used tensorflow rather than tensorflow-gpu, because when you installed tensorflow-CPU and tensorflow-GPU, only CPU will work, you can try

import tensorflow as tf

with tf.device('/cpu:0'): a = tf.constant ([1.0, 2.0, 3.0], shape=[3], name='a') b = tf.constant ([1.0, 2.0, 3.0], shape=[3], name='b') with tf.device('/gpu:1'): c = a + b

sess = tf.Session(config=tf.ConfigProto (allow_soft_placement=True, log_device_placement=True)) sess.run(tf.global_variables_initializer()) print sess.run(c)

if error, you need uninstall protobuf, tensorflow-CPU and tensorflow-GPU, and only install tensorflow-GPU