caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Caffe on Windows

Open bearpaw opened this issue 12 years ago • 234 comments

I have successfully run Caffe on Ubuntu 12.04. I am wondering whether Caffe is able to run on Windows system?

bearpaw avatar Dec 12 '13 04:12 bearpaw

In principle compiling and running on Windows is possible, but we do not have a Makefile for it, nor do we currently plan on supporting it. However, contributions to this end are welcome!

shelhamer avatar Dec 21 '13 21:12 shelhamer

I have ported Caffe to Windows. It is built by Visual Studio 2012.

niuzhiheng avatar Feb 11 '14 08:02 niuzhiheng

Thank you for porting Caffe! Could you publish your code on your fork? We do not officially support windows yet, but we could direct others interested in running Caffe on windows to your work.

shelhamer avatar Feb 11 '14 08:02 shelhamer

Yes, I created a new branch named as "windows" on my own repository.

You may refer to the installation guide for more details.

Look forward to any feedback from all of you.

niuzhiheng avatar Feb 11 '14 14:02 niuzhiheng

@niuzhiheng Can your windows version codes run in a VS2010 environment?

nian-liu avatar Mar 05 '14 14:03 nian-liu

I am not sure for VS2010, but it has been confirmed that both VS2012 professional and VS2012 express are OK. There are two main concerns for other Visual Studio versions:

  1. whether std::thread is working fine with other versions earlier than VS2012.
  2. 3rd-party libraries may need to be rebuilt correspondingly, e.g. OpenCV.

niuzhiheng avatar Mar 06 '14 05:03 niuzhiheng

@niuzhiheng I am wondering could I have your mail ID - I have some questions in building caffe by vs 2010 and would like to get some directions from you. My gmail is [email protected], thanks in advance!

nian-liu avatar Mar 06 '14 07:03 nian-liu

@niuzhiheng I have downloaded your fork, but i can only find the ".dll" files, no ".h" files and "*.lib" files of "3rdparty." it is not easy to build these "x64" libraries in windows, can you share it in the project too? thanks!

zgxiangyang avatar Apr 08 '14 14:04 zgxiangyang

@zgxiangyang The dependencies can be download from here

You may refer to the installation guide for more details.

niuzhiheng avatar Apr 10 '14 06:04 niuzhiheng

@niuzhiheng I have downloaded it before, there are only several".dll" files. But without the corresponding '.lib" files, I have no way to use it in my projects. I can only run the demo. It's too hard for me to build my own libs.

zgxiangyang avatar Apr 11 '14 14:04 zgxiangyang

Thanks a lot @niuzhiheng, your windows port works handsomely on windows server 2012 with VS2012.

One note for others using the windows branch that took me sometime to figure, they should use the old architecture (the one with explicit padding layers) not the new one. i.e. in order to use the cifar sample, they should use this net architecture, not the one in master. Mnist example in master works smoothly as it does not have any padding layers.

aybassiouny avatar Apr 23 '14 10:04 aybassiouny

@aybassiouny you are correct. I am considering to update the windows port to new net architecture and up to date when caffe officially release 1.0 version.

niuzhiheng avatar Apr 25 '14 08:04 niuzhiheng

@niuzhiheng new PR is out!

aybassiouny avatar May 21 '14 12:05 aybassiouny

Hi, I am planning to compile caffe in win32. It seems the dependencies building is difficult. @niuzhiheng Could you help to build win32 dependencies files and share it.

thuanvh avatar Jun 24 '14 04:06 thuanvh

Cmake can generate Visual Studio files. Take a look at https://github.com/BVLC/caffe/pull/442 Instead Mxe[¹] and Cmake could be a good base for compile with mingw for windows target on linux [1]http://mxe.cc/

bhack avatar Jun 24 '14 09:06 bhack

Not all the dependencies are compatible with Windows. For example, the pthread used by the various data layer to prefetch the data is only available on Linux/Unix. If they are not replaced by boost::thread, you can only simulate Linux with MinGW or Cygwin. In my experiences, they brought up too many unnecessary complications and are not suitable for running complex projects such as Caffe and it's dependencies.

If you do want to use Caffe, install the latest version of Ubuntu which is the most popular and the easiest Linux OS.

kloudkl avatar Jun 24 '14 14:06 kloudkl

@kloudkl is right. The official Linux version is well supported by the Caffe community with frequent updates and discussions. The windows porting currently has many limitations and most importantly it is lacking community support.

One may start with this windows porting, if you quite rely on visual studio as your favorite IDE. Once you become familiar with Caffe, you'd better deploy from the official branches.

niuzhiheng avatar Jun 24 '14 15:06 niuzhiheng

I have managed to compile latest caffe using #442, it is kind of a hellish process, but overall I fixed major errors following footsteps of @niuzhiheng's port.

I am a total newbie to github, should I submit it as a pull request to to the windows port?

aybassiouny avatar Jun 28 '14 23:06 aybassiouny

I am interested in caffe for windows. Could you push your changes to github? Could you create a branch and push it up? @aybassiouny

-----Thư Gốc----- Từ: "aybassiouny" [email protected] Gửi: ‎29/‎06/‎2014 6:13 SA Đến: "BVLC/caffe" [email protected] Cc: "thuanvh" [email protected] Chủ đề: Re: [caffe] Caffe on Windows (#15)

I have managed to compile latest caffe using #442, it is kind of a hellish process, but overall I fixed major errors following footsteps of @niuzhiheng's port. I am a total newbie to github, should I submit it as a pull request to to the windows port? — Reply to this email directly or view it on GitHub.

thuanvh avatar Jun 29 '14 10:06 thuanvh

@aybassiouny my advice is to coordinate with @niuzhiheng, who has kindly kept the Windows port at his fork, to make you a collaborator on his repo or otherwise submit a PR there.

A good first step is to push your Windows branch to your own fork and link it in this thread for others to find.

On Sun, Jun 29, 2014 at 3:47 AM, thuanvh [email protected] wrote:

I am interested in caffe for windows. Could you push your changes to github? Could you create a branch and push it up? @aybassiouny

-----Thư Gốc----- Từ: "aybassiouny" [email protected] Gửi: ‎29/‎06/‎2014 6:13 SA Đến: "BVLC/caffe" [email protected] Cc: "thuanvh" [email protected] Chủ đề: Re: [caffe] Caffe on Windows (#15)

I have managed to compile latest caffe using #442, it is kind of a hellish process, but overall I fixed major errors following footsteps of @niuzhiheng's port. I am a total newbie to github, should I submit it as a pull request to to the windows port? — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/15#issuecomment-47451170.

shelhamer avatar Jun 29 '14 19:06 shelhamer