How to build Caffe library on Windows (Visual Studio 2013)? - visual-studio-2013

have anyone successfully using Caffe library in Visual Studio development? If yes, can you make a short overview (step by step).
What I've already done:
- download Caffe from Github
- building Boost
- building Cuda Toolkit 7.5
- building gflags
- building glog
Still have to do:
- hdf5
- protobuf
- GLog
....
Have anyone any instructions?

UPDATE:
Since microsoft adopted the porting of CAFFE to windows , there is now an even easier way to build CAFFE for windows with visual studio. The entire process is depicted in this 5 min video!
i saw the answer by Saeed, and i think i have something easier to propose.
Follow the built found here for a very easy build of Caffe on windows. However, you always have to check it for changes, since their code updates regularly, but their documentation stays behind. In my case (and many other co-workers) their code builts as-is, right out of the box!

It is not recommended to build and use Caffe on Windows,but if you're insisting on that you can find this perfect step-by-step guide so helpful.
Build Caffe in Windows with Visual Studio 2013 + CUDA 6.5 + OpenCV 2.4.9

You can also use Collective Knowledge workflow framework to automatically install Caffe on Windows, Linux or MacOS from command line in just a few steps. See
https://github.com/BVLC/caffe/issues/5654#issuecomment-372123226
https://github.com/dividiti/ck-caffe
Basically, you just need to do the following:
pip install ck
ck pull repo --url=https://github.com/dividiti/ck-caffe
ck install package:lib-caffe-bvlc-master-cudnn-universal --env.CAFFE_BUILD_PYTHON=ON
CK will detect or rebuild all necessary dependencies on Windows (HDF5, Boost, OpenCV, etc). You can then use Caffe from virtual environment as follows:
ck show env
ck virtual env --tags=lib,caffe
python
> import caffe
Hope it's of any help!

Related

Compile OpenCV 3.4 and Cuda 9.2 with MS VS15 2017

I need to do fast image processing so I decide to go for OpenCV with CUDA support. Now I'm trying to build OpenCV as dll to use it in my project, but I am not even able to generate the VS project since CMake keeps giving me this error:
CMakeError. I am on Windows 10, CMake 3.11 with VS 15 2017 x64 generator, OpenCV 3.4 (the last release).
I have installed CUDA 9.2, 9.1 and 8.0 and set CUDA_HOME environment variable as the CUDA toolkit directory. Nothing seems to work.
Then I try to set the CUDA_SDK_ROOT_DIR through the CMake GUI, but the CUDA toolkit directory seems to be not the right one and I'm not able to find the CUDA sample directory anywhere.
I have googled a lot, but I found nothing that had been able to help me. Did someone face this very same issue? How can I solve it?
PS: I have successfully created the dll with TBB and IPP (without CUDA) and it is still not fast enough, so I really need to use Cuda.
I have solved using Cuda 9.1 and VS 15.45. To install CUDA in a correct way you need to use custom installation and delete the VS integration, since it seems to have some problems. Once installation is complete, CMake should detect it.
This is a guide that could help.

Installing Caffe with CUDNN 8.0 and Visual Studio 2015

I'm a bit over my head here, so please try not to strangle me for all the mistakes I am making until the end :)
I am trying to install Caffe using a Windows 10 pc with VS 2015 and CUDNN 8.0. I initially had trouble with the Microsoft supported Caffe files, so I found this link. I couldn't figure out what to do with the first set of files, so I opened up the second set of files and used the official instructions to edit CommonSettings.props, installed the necessary packages, and hit build.
I got an error saying that OpenCV could not be found, even though it was definitely installed. It seemed like it was looking for OpenCV in a place where it did not exist, so I copied the packages into the directory it was looking in. I am now getting an error cannot open file libboost_log-vc140-mt-1_59.lib. I've looked around and I can't find any file like that. What many things am I doing wrong? Thank you.
Check windows branch of official repository. I built it on win10 x64 machine using vs2015 and it works fine.

Unable to use mex on R2010a

I'm using Matlab R2010a. I need to create a custom block embedded with my code for which i require mex. I have Visual Studio Express 2010 installed on my system. I followed the instructions and installed the mex patch for R2010a into the matlabroot folder using the unzip command. I also installed Windows SDK 7.1 64 bit as recommended. However when i type mex -setup no compiler is shown. Any alternative solutions?
Is your matlab 64Bits? I don't think it supports mex (or there is some problems. I don't remember). I had this problem and switched to a newer version.

Compiling OpenCV on Windows 7 64bit

I'm trying to get OpenCV working on Windows 7 64bit.
I tried installing the vs2008.exe installer bundle from the OpenCV website but it produced errors when trying to compile, I Google'd these and it appears that installer is no good for 64bit versions of Windows 7, bugger.
I've tried having a crack at compiling using CMake, but really having no luck, does anyone know of a way to get OpenCV installed on here so I can use it in VS2010?
Cheers
Managed to solve it, in the 'release' folder which CMake creates I was opening the wrong file with VS2010, I opened the project file and then had it run a build.
Then I changed the parameters in my project which wanted to use OpenCV to look in release for the appropriate files, needed a bit of fiddling but I think I have it now.
For anyone else interested in a guide how to compile OpenCV with TBB support in Visual Studio 2010, I created a video tutorial for it: http://www.youtube.com/watch?v=XeBhwbRoKvk
(although this is for Windows 7 32 bit)

Build GTK with Windows SDK

how can I compile gtk (itself) with Windows SDK ?
Building in Visual Studio is still quite a lot of work. I've done it, but I don't have reproducible steps for you right now. However, if you have a Linux machine around and are willing to cross-compile I have written up directions on how to build GTK+ for Win32 by cross-compiling.
http://live.gnome.org/Cross%20compiling%20GTK%2B%20for%20Win32
It's also possible to build using MSYS in the command-line on Windows, but that's also a major pain in the ass to get setup. It's also really, really slow. Cross-compiling from Linux is, at a minimum, ten times faster. I'm not 100% sure but it seems to be because if you build using the standard build system then there is a lot of process spawning, which is quite expensive in Win32 compared to Linux.
However, if you want to go this way then install MSYS and pull down the source for glib, atk, cairo, pango, and gtk+.. then try to build using the standard Linux way:
1/ untar the source tarball
2/ in the source's root directory do: ./configure
3/ make
There will undoubtedly be other dependencies that you need to install, such as libpng and libjpeg.
Try the HexChat builds. They use Visual Studio 2010 and come with some prepared scripts and solutions to make your life much easier. Oh and you get binary downloads as well.
http://gtk.hexchat.org/
GTK can be compiled under Cygwin or Microsoft Visual C++.
Did you try this installation method? Look the Microsoft Windows section...
Hope it helps!

Resources