Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running the demo on Python 2.7.12 Cuda 10 and Cudnn 7. Error in /caffe_pb2.py #933

Open
astronaut71 opened this issue Mar 27, 2020 · 0 comments

Comments

@astronaut71
Copy link

astronaut71 commented Mar 27, 2020

Hello

Im using Ubuntu 16.04, Python 2.7.12 Cuda 10 and Cudnn 7., and protoc version 3.11 ibprotoc 3.11.4. and protobuf 3. 11.4. as well. I followed the Ubuntu 16 Installation guide for Caffee here

https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-Installation-Guide

Then find out that caffe-fast-rcnn is not compatible with cudnn 5.1, and a code error will be reported when compiling caffe-fast-rcnn. As Im using cudnn 7 and Cuda 10 was wondering if the changes made in order to work with cudnn 5.1 can be good enough to work with v7. So far I done this:

Replaced the corresponding files of faster rcnn with the following files of the latest caffe source

include / caffe / layers / cudnn_relu_layer.hpp,
src / caffe / layers / cudnn_relu_layer.cpp,
src / caffe / layers / cudnn_relu_layer.cu
src / caffe / layers / cudnn_sigmoid_layer.cpp,
src / caffe / layers / cudnn_sigmoid_layer.cu
include / caffe / layers / cudnn_sigmoid_layer.hpp,
include / caffe / layers / cudnn_tanh_layer.hpp,
src / caffe / layers / cudnn_tanh_layer.cpp,
src / caffe / layers / cudnn_tanh_layer.cu

Then Replace the corresponding file include / caffe / util / cudnn.hpp with this file in the caffe source code. Replace all cudnnConvolutionBackwardData_v3 function names in the src / caffe / layers / cudnn_conv_layer.cu file in faster rcnn with cudnnConvolutionBackwardData
cudnnConvolutionBackwardFilter_v3 function names with cudnnConvolutionBackwardFilter

So I was able to compile and pass all the test. In Makefile i done this settings
PYTHON_LIBRARIES := boost_python python2.7
For Makefile.config have this settings

USE_CUDNN := 1
# CPU_ONLY := 1
# OPENCV_VERSION := 3

CUDA_ARCH := #-gencode arch=compute_20,code=sm_20 \
		#-gencode arch=compute_20,code=sm_21 \
		-gencode arch=compute_30,code=sm_30 \
		-gencode arch=compute_35,code=sm_35 \
		-gencode arch=compute_50,code=sm_50 \
		-gencode arch=compute_52,code=sm_52 \
		-gencode arch=compute_60,code=sm_60 \
		-gencode arch=compute_61,code=sm_61 \
		-gencode arch=compute_61,code=compute_61

BLAS := atlas
PYTHON_INCLUDE := /usr/include/python2.7 /usr/local/lib/python2.7/dist-packages/numpy/core/include  

PYTHON_LIB := /usr/lib
 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial

After succes of all cafee test when run the demo with ./tools/demo.py I got this error

File "/home/admini/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/io.py", line 8, in
from caffe.proto import caffe_pb2
File "/home/admini/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/proto/caffe_pb2.py", line 22, in
Method\x12\x07\n\x03MAX\x10\x00\x12\x07\n\x03\x41VE\x10\x01\x12\x0e\n\nSTOCHASTIC\x10\x02"W\n\x0ePReLUParameter\x12&\n\x06\x66iller\x18\x01 \x01(\x0b\x32\x16.caffe.FillerParameter\x12\x1d\n\x0e\x63hannel_shared\x18\x02 \x01(\x08:\x05\x66\x61lse*\x1c\n\x05Phase\x12\t\n\x05TRAIN\x10\x00\x12\x08\n\x04TEST\x10\x01'
TypeError: init() got an unexpected keyword argument 'syntax'

Try to solve it but no help. Please can you advice.
Thanks

@astronaut71 astronaut71 changed the title Error while running the demo on Python 2.7.12 Cuda 10 and Cudnn 7, caffe_pb2.py Erorr Error while running the demo on Python 2.7.12 Cuda 10 and Cudnn 7. Error in /caffe_pb2.py Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant