leovandriel / caffe2_cpp_tutorial

C++ transcripts of the Caffe2 Python tutorials and other C++ example code
BSD 2-Clause "Simplified" License
431 stars 94 forks source link

i can not do make on caffe2_cpp_tutorial #78

Open ansonchiou opened 6 years ago

ansonchiou commented 6 years ago

first i mkdir build in folder of caffe2_cpp_tutorial/ and cd build anddo cmake .. finally i got error message , ../caffe2: warning: directory does not exist. CMake Error at CMakeLists.txt:36 (message): Caffe2 lib not found

alexge233 commented 6 years ago

You don't seem to have Caffe2 installed? What is the output of sudo ldconfig -p | grep "libcaffe2*"

terranceliu commented 6 years ago

Hello, I'm running into this issue as well. Do you recommend building caffe2 from source?

I followed the installation directions given here: https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile and I successfully tested my installation, but I am having building this project.

sudo ldconfig -p | grep "libcaffe2*" is also returning nothing

terranceliu commented 6 years ago

Hello, I'm running into this issue as well. Do you recommend building caffe2 from source?

I followed the installation directions given here: https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile and I successfully tested my installation, but I am having building this project.

sudo ldconfig -p | grep "libcaffe2*" is also returning nothing

Nevermind, had to move libcaffe2.so

i-chaochen commented 6 years ago

Same issue here. I am wondering do I need to install by build from source again? because my caffe2 was directly installed by conda install pytroch

OleRoel commented 5 years ago

@terranceliu Can you please be more specific in what you did? I tried

ldconfig -n -v /pytorch/build/lib.linux-x86_64-2.7/torch/lib

but still get an empty result when I run

ldconfig -p | grep "libcaffe2*"

in the cli.

My Caffe2 installation has been following the steps given here: https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile

Mengjintao commented 5 years ago

I find my libcaffe2.so is located in /usr/local/lib/python2.7/dist-packages/torch/lib. What should we do to make your project successfully?

Mengjintao commented 5 years ago

Is there still anyone maintaining this project?

beniz commented 5 years ago

Hi @Mengjintao I don't know, but for our own purposes we did rewrite the C++ part for training and inference of Caffe2 models, including multiple flavors of Detectron, as well as new operators, see https://github.com/jolibrain/deepdetect/tree/master/src/backends/caffe2

It may not fit your purpose as it is not designed to be used outside of deepdetect, though you may build around the main code functionalities typically, and the nettools here: https://github.com/jolibrain/deepdetect/tree/master/src/backends/caffe2/nettools

OleRoel commented 5 years ago

@Mengjintao Never mind, I am now using the stable LibTorch package from the PyTorch website instead of trying to build the lib myself.

My plan was to use this repository as a starting point into Caffe 2 development. But it looks like I tried to start with Caffe2 right after it got merged with PyTorch. And the documentation and guides still seems to recover from that move. I guess (or excuse my personal hick-ups) this is not the ideal point in time for learning Caffe2.

Mengjintao commented 5 years ago

Caffe2's Python API works fine, but the C++ API definitely not. MACE's benchmark did not include Caffe2 into their benchmark, I guess they may failed to do so.

OleRoel commented 5 years ago

Caffe2's Python API works fine, but the C++ API definitely not. MACE's benchmark did not include Caffe2 into their benchmark, I guess they may failed to do so.

Actually I am using the Caffe2 C++ API. The by far biggest problem for me is lack of documentation and example codes to get a better understanding of the API. For example, I am trying to implement a basic MNIST network with one hidden layer and have a hard time figuring out how to initialize a tensor as a vector with constant float values. Ones, zeros and random values are easy but a set of own values?

andviane commented 5 years ago

All you need is to fix CMakeLists.txt find_library entries (CAFFE2_LIB and maybe others) so that it is possible to find the available Caffe2 libraries like libCaffe2_CPU.so or libCaffe2_GPU.so. Read the find_library documentation here for how. If you are not sure where is your Caffe2 installation, use tools like find to locate them. If you really cannot locate, most likely, Caffe2 is not present on your machine or maybe has not been built properly.

soyail commented 4 years ago

I get in the same trouble, even though I have already installed caffe2 successfully. I can find libCaffe2_CPU.so under caffe2/cmake-build-debug/caffe2, but when I type "sudo ldconfig | grep "libcaffe2*" ", it returns nothing. I added " message("${CAFFE2_LIB}") " in the CMakeLists.txt, it also returns nothing, but glogs_lib can be found. I really want to know how to find the library "libCaffe2_CPU.so", what should I do?