smallcorgi / Faster-RCNN_TF

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

Loaded runtime CuDNN library: 5006 (compatibility version 5000) but source was compiled with 5103 (compatibility version 5100) #12

Closed zzy-ucas closed 7 years ago

zzy-ucas commented 7 years ago

I got an error when I run the demo.py with GPU. Environment: ubuntu14.04+python2.7+cuda7.5+cudnn5.1

root@SSAP-G3-Guest:~/Workspace/faster-rcnn-master# python tools/demo.py --model models/VGGnet_fast_rcnn_iter_70000.ckpt 

The error is as follows:

Loaded network models/VGGnet_fast_rcnn_iter_70000.ckpt
E tensorflow/stream_executor/cuda/cuda_dnn.cc:378] Loaded runtime CuDNN library: 5006 
(compatibility version 5000) but source was compiled with 5103 (compatibility version 5100).  
If using a binary install, upgrade your CuDNN library to match. 
If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration.
F tensorflow/core/kernels/conv_ops.cc:532] Check failed: stream->parent()->GetConvolveAlgorithms(&algorithms) 
Aborted (core dumped)

Thanks!

tracer9 commented 7 years ago

Hi zhengyuanzhang, I met same problem and it was because I installed cuDNN v5.0. Uninstall your current cuDNN and install cuDNN5.1 may help!

zzy-ucas commented 7 years ago

Hooray~~~The steps I solved the problems as follows: First, remove the current cuDNN files, and reinstall the cuDNN v5.1 with official steps:

rm /usr/local/cuda/include/cudnn.h rm /usr/local/cuda/lib64/libcudnn*

tar zxvf cudnn-7.5-linux-x64-v5.tgz sudo cp cuda/include/cudnn.h /usr/local/cuda/include sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

but it does not work at all, so I relink them one by one like this:

ln -s libcudnn.so.5 -> libcudnn.so ln -s libcudnn.so.5.1.3 -> libcudnn.so.5

lrwxrwxrwx 1 root root 13 Oct 21 11:26 libcudnn.so -> libcudnn.so.5 lrwxrwxrwx 1 root root 17 Oct 21 11:25 libcudnn.so.5 -> libcudnn.so.5.1.3 -rwxr-xr-x 1 root root 60696704 Oct 21 10:48 libcudnn.so.5.1.3*

and it works. Then I met the problem with matplotlib, this is because I run the codes on the servers.

Loaded network models/VGGnet_fast_rcnn_iter_70000.ckpt

Demo for data/demo/000456.jpg Detection took 1.955s for 300 object proposals Traceback (most recent call last): File "tools/demo.py", line 135, in demo(sess, net, im_name) File "tools/demo.py", line 73, in demo fig, ax = plt.subplots(figsize=(12, 12)) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1177, in subplots fig = figure(_fig_kw) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 527, in figure _kwargs) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 46, in new_figure_manager return new_figure_manager_given_figure(num, thisFig) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 53, in new_figure_manager_given_figure canvas = FigureCanvasQTAgg(figure) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 76, in init FigureCanvasQT.init(self, figure) File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 68, in init _create_qApp() File "/root/Util/miniconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 138, in _create_qApp raise RuntimeError('Invalid DISPLAY variable') RuntimeError: Invalid DISPLAY variable

To solve this problems, we can add the code(down there)to the file in $HOME/.config/matplotlib/matplotlibrc(refer to http://stackoverflow.com/questions/21321292/using-matplotlib-when-display-is-undefined and http://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined)

backend: agg

Then I met the same problems which can be solved refering to:https://github.com/smallcorgi/Faster-RCNN_TF/issues/2

And the final comeout:

Loaded network models/VGGnet_fast_rcnn_iter_70000.ckpt

Demo for data/demo/000456.jpg Detection took 1.937s for 300 object proposals

Demo for data/demo/000542.jpg Detection took 0.291s for 261 object proposals

Demo for data/demo/001150.jpg Detection took 0.275s for 242 object proposals

Demo for data/demo/001763.jpg Detection took 0.285s for 260 object proposals

Demo for data/demo/004545.jpg Detection took 0.280s for 300 object proposals

Thanks a lot!