Using Caffe in Visual Studio 2015 with C++

621 views
Skip to first unread message

Alfonso Soriano

unread,
Jul 7, 2017, 3:02:07 PM7/7/17
to Caffe Users
Hi all,

I have found a distinct lack of documentation on how to install Caffe for use with a C++ Project in Visual Studio 2015. I am quite new to using Caffe and would appreciate any help I could get.

Some information: I am using Visual Studio 2015 and want to add Caffe to an existing C++ Project. I am using x64 Release Mode with a CPU Only Build.

Here is what I have done so far:
- Used the commands listed here https://github.com/BVLC/caffe/tree/windows to build Caffe using Windows
- I am then able to build the example projects successfully

Now, at this point, the documentation on the Github ends and I am very confused. Here are some theories about what I think I might have to do, some guidance on which of these is correct might be useful:
1 - Use CMake to install Caffe into my existing project (I have no idea how to do this and have tried to look online, but for a beginner, the CMake documentation is pretty bad and so some guidance would be appreciated)
2 - Try to manually install Caffe by modifying properties and sorting out dependencies on my own (I tried this but quickly ran into problems)
3 - Trying to hijack the property sheets of the sample project (I also tried this but it didn't really work out)

I tried a few other things too that obviously didn't work, again I have no idea what I'm doing so any help would be greatly appreciated. Thank you all so much.


Atena Nguyen

unread,
Jul 8, 2017, 4:23:22 AM7/8/17
to Caffe Users
Hi Alfonso, 

I also face with the same problem but still have not found the solution yet. I got "#error directive error" for different version of protobuf, cannot open source file "cublas_v2.h, cuda.h, cuda_runtime.h", and many more. 
I found quite some example on C++ interface but none talk about how to get it run. 

There is one guideline on how to build caffe with visual c++ and python, may be i will try to follow that one and see what happen, 

Do you make any progress? 


Vào 04:02:07 UTC+9 Thứ Bảy, ngày 08 tháng 7 năm 2017, Alfonso Soriano đã viết:

Atena Nguyen

unread,
Jul 11, 2017, 10:05:24 AM7/11/17
to Caffe Users
I have run MNIST training and testing phase successfully in Visual Studio 2015, C++ interface. 
I will update my answer soon. 

Alfonso Soriano

unread,
Jul 12, 2017, 6:34:28 PM7/12/17
to Caffe Users
Hi Atena, yes I have since solved this issue, thank you.

Atena Nguyen

unread,
Jul 16, 2017, 2:46:43 AM7/16/17
to Caffe Users
I have managed to run MNIST example with VS2015, but still got C4743 warning and error C2220 when adding Caffe to my existing project. 
Do you have any idea how to fix it?

Bests, 

Vào 07:34:28 UTC+9 Thứ Năm, ngày 13 tháng 7 năm 2017, Alfonso Soriano đã viết:

Yadnyesh Luktuke

unread,
Jan 27, 2018, 10:53:28 PM1/27/18
to Caffe Users
Hi Alfonso,

Could you please provide an update of your steps here? I'm struggling with the same problem.

Thanks and Regards
Yadnyesh

Le Xuan Tuan Anh

unread,
Jan 28, 2018, 8:51:40 PM1/28/18
to Caffe Users
Hi @Atena Nguyen , @Alfonso
Please provide  information about your build caffe steps .
Reply all
Reply to author
Forward
0 new messages