obendidi / Tracking-with-darkflow

Real-time people Multitracker using YOLO v2 and deep_sort with tensorflow
GNU General Public License v3.0
524 stars 174 forks source link

yolo2 and deepsort models run on the same gpu? #26

Open ifangcheng opened 6 years ago

ifangcheng commented 6 years ago

it seems that in this project yolo2 and deepsort models run on the same gpu, can it be configured to run different models on multiple different gpus to further improve the fps of the whole end-to-end system?

obendidi commented 6 years ago

you can change the GPU Flag in YOLO :

FLAGS.gpuName = '/gpu:0'

by default it's on GPU 0 , but you can set it to another GPU (for example /gpu:1) , hopefully deep_sort will still run on GPU 0 (I only have one GPU so can't test it )

Another thing to try is to set deep sort to run on GPU 1 , by adding this line to deep sort tf_session :

config = tf.ConfigProto(device_count = {'GPU': 1})
session = tf.Session(config=config) 

these should replace line 318 in the script deep_sort/generate_detection.py

if it works out, a pull request would be appreciated for future users :)

ifangcheng commented 6 years ago

thanks for reply! i will try to test it, hopefully it works.

ifangcheng commented 6 years ago

I tried the two ways you mentioned, however it both turns out that they have no effects on the gpu assignment. it always used both of the memory of gpu0 and gpu1 but the gpu util shows only the percent value(like 40%-60%)on gpu0, while 0% on gpu 1

obendidi commented 6 years ago

try using with tf.device("GPU:1"): before calling the encoder I'm sorry I don't have the required hardware so can't really help much