theAIGuysCode / yolov4-deepsort

Object tracking implemented with YOLOv4, DeepSort, and TensorFlow.
GNU General Public License v3.0
1.34k stars 753 forks source link

why my model only use the cpu #34

Open AmberLuke opened 4 years ago

AmberLuke commented 4 years ago

Thank you for your contribution. cpu:i5 6500 gpu: gtx 1080 when I run this model, I only got about 2-3fps,and I use the command "nvidia-smi",the use of Gpu memory is only about 500mb/8116mb, I have install tf-gpu following your text. when I run the "python object_tracker.py --video ./data/video/test.mp4 --output ./outputs/demo.avi --model yolov4",there is always a "Qt: Session management error: None of the authentication protocols",then the fps is really low.I'm really appreciate if you can offer some help! my conda list: _libgcc_mutex 0.1 conda_forge https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge _openmp_mutex 4.5 1_gnu https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge absl-py 0.11.0 astunparse 1.6.3 bzip2 1.0.8 h516909a_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge ca-certificates 2020.6.20 hecda079_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge cachetools 4.1.1 cairo 1.16.0 hcf35c78_1003 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge certifi 2020.6.20 py37he5f6b98_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge chardet 3.0.4 cudatoolkit 10.1.243 h6bb024c_0 defaults cudnn 6.0 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free cycler 0.10.0 py_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge dbus 1.13.6 h7a60e0d_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge easydict 1.9 expat 2.2.9 he1b5a44_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge ffmpeg 4.3.1 h3215721_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge fontconfig 2.13.1 h86ecdb6_1001 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge freetype 2.10.4 h7ca028e_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge gast 0.3.3 gettext 0.19.8.1 hf34092f_1004 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge glib 2.66.2 h58526e2_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge gmp 6.2.0 h58526e2_4 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge gnutls 3.6.13 h79a8f9a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge google-auth 1.23.0 google-auth-oauthlib 0.4.2 google-pasta 0.2.0 graphite2 1.3.13 he1b5a44_1001 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge grpcio 1.33.2 gst-plugins-base 1.14.5 h0935bb2_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge gstreamer 1.14.5 h36ae1b5_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge h5py 2.10.0 harfbuzz 2.4.0 h9f30f68_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge hdf5 1.10.6 nompi_h3c11f04_101 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge icu 64.2 he1b5a44_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge idna 2.10 importlib-metadata 2.0.0 jasper 1.900.1 h07fcdf6_1006 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge jpeg 9d h36c2ea0_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge Keras-Preprocessing 1.1.2 kiwisolver 1.3.0 py37hc928c03_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge lame 3.100 h14c3975_1001 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge lcms2 2.11 hbd6801e_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libblas 3.9.0 2_openblas https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libcblas 3.9.0 2_openblas https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libclang 9.0.1 default_hde54327_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libedit 3.1.20191231 he28a2e2_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libffi 3.2.1 1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free libgcc-ng 9.3.0 h5dbcf3e_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libgfortran-ng 7.5.0 hae1eefd_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libgfortran4 7.5.0 hae1eefd_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libgfortran5 9.3.0 he4bcb1c_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libglib 2.66.2 hbe7bbb4_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libgomp 9.3.0 h5dbcf3e_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libiconv 1.16 h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge liblapack 3.9.0 2_openblas https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge liblapacke 3.9.0 2_openblas https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libllvm9 9.0.1 he513fc3_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libopenblas 0.3.12 pthreads_h4812303_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libopencv 4.5.0 py37_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libpng 1.6.37 h21135ba_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libstdcxx-ng 9.3.0 h2ae2ef3_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libtiff 4.1.0 hc7e4089_6 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libuuid 2.32.1 h14c3975_1000 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libwebp-base 1.1.0 h516909a_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libxcb 1.12 1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free libxkbcommon 0.10.0 he1b5a44_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libxml2 2.9.10 hee79883_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge lxml 4.6.1 lz4-c 1.9.2 he1b5a44_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge Markdown 3.3.3 matplotlib 3.3.2 py37hc8dfbb8_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge matplotlib-base 3.3.2 py37hc9afd2a_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge ncurses 6.2 he1b5a44_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge nettle 3.4.1 h1bed415_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge nspr 4.29 he1b5a44_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge nss 3.58 h27285de_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge numpy 1.19.2 py37h7008fea_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge numpy 1.18.5 oauthlib 3.1.0 olefile 0.46 pyh9f0ad1d_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge opencv 4.5.0 py37_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge opencv-python 4.1.1.26 openh264 2.1.1 h8b12597_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge openssl 1.0.2u h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge opt-einsum 3.3.0 pcre 8.44 he1b5a44_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pillow 8.0.1 py37h718be6c_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pip 20.2.4 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pixman 0.38.0 h516909a_1003 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge protobuf 3.13.0 py-opencv 4.5.0 py37hc6149b9_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pyasn1 0.4.8 pyasn1-modules 0.2.8 pyparsing 2.4.7 pyh9f0ad1d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pyqt 5.12.3 py37h8685d9f_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge python 3.7.0 hd21baee_1006 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge python-dateutil 2.8.1 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge python_abi 3.7 1_cp37m https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge qt 5.12.5 hd8c4c69_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge readline 7.0 hf8c457e_1001 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge requests 2.24.0 requests-oauthlib 1.3.0 rsa 4.6 scipy 1.4.1 setuptools 49.6.0 py37he5f6b98_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge six 1.15.0 pyh9f0ad1d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge sqlite 3.33.0 h62c20be_0 defaults tensorboard 2.2.2 tensorboard-plugin-wit 1.7.0 tensorflow-gpu 2.3.0rc0 termcolor 1.1.0 tf-estimator-nightly 2.3.0.dev2020062301 tk 8.6.10 hed695b0_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge tornado 6.1 py37h4abf009_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge tqdm 4.51.0 urllib3 1.25.11 Werkzeug 1.0.1 wheel 0.35.1 pyh9f0ad1d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge wrapt 1.12.1 x264 1!152.20180806 h14c3975_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-kbproto 1.0.7 h14c3975_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-libice 1.0.10 h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-libsm 1.2.3 h84519dc_1000 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-libx11 1.6.12 h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-libxext 1.3.4 h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-libxrender 0.9.10 h516909a_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-renderproto 0.11.1 h14c3975_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-xextproto 7.3.0 h14c3975_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xorg-xproto 7.0.31 h14c3975_1007 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge xz 5.2.5 h516909a_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge zipp 3.4.0 zlib 1.2.11 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

AmberLuke commented 4 years ago

I run the code on the Ubuntu,not Windows.

victorvargass commented 4 years ago

Did you try with pip environment?

For this, you have to create an pip environment like this:

virtualenv ENV_NAME -p PYTHON_VERSION for example: virtualenv venv -p python3

then activate your venv: source venv/bin/activate

then, install the libraries with the requirements-gpu.txt file pip install -r requirements-gpu.txt

And try ! :D

allenwu5 commented 3 years ago

I have a similar issue, refer to https://github.com/theAIGuysCode/yolov4-deepsort/issues/46#issuecomment-790264045

taehyeon3549 commented 3 years ago

i am fixed by check my tenserflow version and CUDA version.

checking with this page : https://www.tensorflow.org/install/source_windows#tested_build_configurations

OS : window 10 CUDA : 11.0 CUDNN : 8 for cuda 11.0 tensorflw : tensorflow_gpu-2.4.0 GPU : GTX 1060( for laptop)

check the Tensorflow can use GPU !! >>

>> python Python >>> import tensorflow as tf 2021-03-11 14:50:27.835987: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll >>> tf.test.is_gpu_available() True >>> tf.test.gpu_device_name() '/device:GPU:0' (it can be different) >>> tf.config.experimental.list_physical_devices(device_type='GPU') [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

p.s) FIRST!! follow @Victorvargass 's comment

then you can FIXED it :dancing_men: screenshot

Akai-ai commented 3 years ago

tf.config.experimental.list_physical_devices(device_type='GPU')

Hi,I also have this issue,and I have fixed it with check tenserflow version and CUDA version. But when i run python save_model.py --model yolov4 it have a error: Traceback (most recent call last): File "save_model.py", line 67, in app.run(main) File "C:\ProgramData\Miniconda3\envs\yolov4-deepsort-master\lib\site-packages\absl\app.py", line 312, in run _run_main(main, args) File "C:\ProgramData\Miniconda3\envs\yolov4-deepsort-master\lib\site-packages\absl\app.py", line 258, in _run_main sys.exit(main(argv)) File "save_model.py", line 62, in main save_tf() File "save_model.py", line 56, in save_tf utils.load_weights(model, FLAGS.weights, FLAGS.model, FLAGS.tiny) File "F:\yolov4-deepsort-master\core\utils.py", line 63, in load_weights conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 554878 into shape (256,256,3,3)

what should i do??