Open Coderx7 opened 7 years ago
OK, I found the cause and how to fix it. since caffe is compiled using python2, tensorflow needs to be compiled with python2 as well. I simply created a new virtualenv for python 2 and thanks to God, it worked just fine. though it did not recognize PReLU! (using tensorflow 0.11) any help in this regard is appreciated though.
(tensorflow_vp2)hossein@hossein-pc:/media/hossein/tmpstore/caffe-tensorflow-master$ ./convert.py cifar10_deploy_14.prototxt --code-output-path=mynet2.py
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
------------------------------------------------------------
WARNING: PyCaffe not found!
Falling back to a pure protocol buffer implementation.
* Conversions will be drastically slower.
* This backend is UNTESTED!
------------------------------------------------------------
Error encountered: Unknown layer type encountered: PReLU
you must have protobuf same as your protoc version, i guess you have a higher version of protobuf in the python2.7 site packages, remove the higher version and install sam as protoc version, i guess it should be 2.6.1. the detail is given below
i have compiled caffe on Ubuntu 16.04 LTS both with python 2 and python, it is really a hectic process for beginners, for caffe with python 2.7 make sure that your /.local/lib/python2.7/site-packages only contains a version same as you protoc version. protoc version can be checked by entering
protoc --version
for me i got problems with python 2.7 because by mistake i installed protbuf 3.0 alpha in python 2.7 site packages, so there was a protobuf error after removing it from python 2.7 site packages everything worked fine also install python-dev version
apt-get install the python3.x-dev
and for python 3.5 make sure you have python 3.0 alpha, if you have both python 2.7 and python 3.x in the system use pip3 otherwise use pip
pip3 install protobuf==3.0.0-alpha-3
or another protobuf such as 3.5 version of protobuf. also do this
pip3 install python-dateutil --upgrade
after that do
make clean
make all -j8
make runtest -j8
make pycaffe
after performing make all make runtest steps don't forget to do that
sudo ldconfig
hope everything works OK for you.
I have tensorflow 0.11 (python3.4) with cuda support, (cuda 8, cudnn5.1) on ubuntu 14.0.4.5. Caffe is installed there as well and working fine.(by the way its python2) I tried to run the mnist example, but it fails with these error messages:
Whats wrong here? and what did I miss? !