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

Can't find ModelDef or ModelMeta #48

Closed ctraina closed 6 years ago

ctraina commented 6 years ago

I've built caffe2 and successfully "borrowed" your tutorial and toy tests, but when I try to use your MNIST test, it can't find ModelDef or ModelMeta (build errors). Where are these defined?

leovandriel commented 6 years ago

Hi, the MNIST example relies on ModelDef defined in model.h. You will also need NetDef and the implementations in src/caffe2/util. You could just add the header files to your project and then link with the libcaffe2_cpp.a in the build folder. Alternatively you can include the sources, or just copy paste the methods MNIST uses, which are few.

ctraina commented 6 years ago

FYI: I got this working, but one of the headaches was a hard-coded path to log data to /tmp (which crashed when it didn't exist). In Windows, this folder only exists if you explicitly create it.