-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from happynear/master
Master
- Loading branch information
Showing
626 changed files
with
75,605 additions
and
47,554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FAQ for caffe-windows | ||
================ | ||
|
||
- How to use the static library `caffelib.lib` in my own project? | ||
|
||
Directly link the `caffelib.lib` may lead the compiler ignore the layer and solver register macros. When loading a layer or solver, | ||
similar error will be reported: | ||
``` | ||
check failed: registry.count(type)==1(0 vs 1)unknown layer type:convolution | ||
``` | ||
There are two ways to solve this problem. One is to add the caffelib project to your own solution, and open the property window of | ||
your project set | ||
`Common Property` - `Reference` - `caffelib` - `Project Reference Property` - `Library Dependency Link`: True . | ||
|
||
Another method is to add `layer_factory.cpp` and `force_link.cpp` to your own project, to let the compiler know the existence of | ||
the layers and solvers. However, when using this method, the layers will be registered twice and you will get an error in `include/caffe/layer_factory.hpp` line `68`. To fix this error, you can just remove line `68-69` or use `if(registry.count(type) > 0) continue;` to replace the `CHECK` statement. | ||
|
||
If you came across similar error when using `caffe.exe`, I guess you may have modified the `.vcxproj` files manually by yourself. VS lost some configurations during your modification. Never mind, you can still follow the above instructions to fix it. | ||
|
||
- How to compile the codes in Debug mode? | ||
|
||
There is a [3rdparty library archive file](http://pan.baidu.com/s/1qW88MTY) provided by a friend of me. However, I haven't tested it. | ||
|
||
You can compile your own third party libraries from https://github.com/willyd/caffe-windows-dependencies . This way is the most recommended, because you can better understand Visual Studio during configuring so much applications. | ||
|
||
In addition, you can still debug the codes in Release mode, by following the instructions here https://msdn.microsoft.com/en-us/library/fsk896zz.aspx . | ||
|
||
- How can I create other tools, such as `extract_features.cpp` and `cpp_classification.cpp`? | ||
|
||
I have only created projects which is used most frequently in my eyes. If you want to compile other tools, there is no need to create a new project. You can just copy and rename `./build/MSVC` folder to another one, and add the new project to the VS solution. Remove `caffe.cpp` and add your target cpp file. Compile it, then you will get a corresponding exe file in `./bin`. | ||
|
||
- Why can't my VS open the projects? | ||
|
||
This is mainly because your CUDA version is different from mine, CUDA 7.0. You can modify the CUDA configurations in the `.vcxproj` file manually by open each `.vcxproj` with notepad or other text processor. | ||
|
||
However, manually modifying the project file may destroy some of the configurations. Someone reported that the reference relationship between the projects was lost after they modified the project files. You may refer to the second question to solve this problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,76 @@ | ||
Forked from https://www.github.com/BVLC/caffe master branch in 2015/6/5 | ||
**News:** Now the offical caffe has merged the windows fork maintained by [Microsoft](https://github.com/microsoft/caffe): https://github.com/BVLC/caffe/tree/windows . | ||
|
||
Added [Batch Normalization](http://arxiv.org/abs/1502.03167), [Parametric ReLU](http://arxiv.org/abs/1502.01852), Locally Connected Layer, Normalize Layer, [Randomized ReLU](http://arxiv.org/abs/1505.00853). | ||
I think it is time to turn your code to the official version. This repository, `caffe-windows`, will be used for my personal research from right now. Thank you all guys who have been making contribution to the windows version of Caffe! | ||
|
||
Setup step: | ||
====== | ||
1. Download third-party libraries from http://pan.baidu.com/s/1sjE5ER7 , and put the 3rdparty folder under the root of caffe-windows. If your VS version is not 2012, please refer to [this project](https://github.com/willyd/caffe-windows-dependencies) to create 3rdparty libraries. | ||
People who do research in Facial Analysis or Visualization may continue to follow my `ms` branch([link](https://github.com/happynear/caffe-windows/tree/ms)). I will keep updating layers and scripts of these two areas. | ||
|
||
2. Run ./src/caffe/proto/extract_proto.bat to create caffe.pb.h, caffe.pb.cc and caffe_pb2.py. | ||
I have made a list of some frequently asked questions in [FAQ.md](FAQ.md). If you get confused during configuring, please firstly look up for your question in the [FAQ.md](FAQ.md). This FAQ list is still under construction, I will keep adding questions into it. | ||
|
||
3. Double click ./build/MSVC/MainBuilder.sln to open the solution in Visual Studio 2012. Higher version of VS can also work, but you must create your own 3rdparty libraries. | ||
## Setup step: | ||
|
||
1. Download third-party libraries from [BaiduYun Disk](http://pan.baidu.com/s/1eStyfrc) or [OneDrive](https://onedrive.live.com/redir?resid=A7AB61436C858EB9!1145&authkey=!AHlCN80o3Rx3n3E&ithint=file%2crar) and extract the files to `caffe-windows_root/3rdparty/`. **Please don't forget to add the `./3rdparty/bin` folder to your environment variable `PATH`.** | ||
|
||
2. Run `./src/caffe/proto/extract_proto.bat` to create `caffe.pb.h`, `caffe.pb.cc` and `caffe_pb2.py`. | ||
|
||
3. Double click ./buildVS2013/MainBuilder.sln to open the solution. If you do not have a Nvidia GPU, please open ./build_cpu_only/MainBuilder.sln. | ||
|
||
4. Change the compile mode to Release and X64. | ||
|
||
5. Change the CUDA include and library path to your own ones. | ||
5. Modify the cuda device compute capability defined in the settings (`caffelib properties` -> `CUDA C/C++` -> `Device` -> `Code Generation`) to your GPU's compute capability (such as compute_30,sm_30; etc). You can look up for your GPU's compute capability in https://en.wikipedia.org/wiki/CUDA . Some general GPUs' compute capabilities are listed below. | ||
|
||
- If your GPU's compute capability is below or equal to 2.1, please remove the `USE_CUDNN` macro in the proprocessor definition of all projects. | ||
- If you are using cpu only solution, just ignore this step. | ||
|
||
6. Compile. | ||
|
||
TIPS: If you have MKL library, please add the preprocess macro "USE_MKL" defined in the setting of the project. | ||
| GPU | Compute Capability | | ||
| ------------------------------------------- |:---------------------:| | ||
| GTX660, 680, 760, 770 | compute_30,sm_30 | | ||
| GTX780, Titan Z, Titan Black, K20, K40 | compute_35,sm_35 | | ||
| GTX960, 980, Titan X | compute_52,sm_52 | | ||
|
||
|
||
中文安装说明:http://blog.csdn.net/happynear/article/details/45372231 | ||
|
||
Matlab Wrapper | ||
====== | ||
Just change the Matlab include and library path defined in the settings and compile. | ||
Don't forget to add ./matlab to your Matlab path. | ||
### Matlab Wrapper | ||
|
||
Just replace the Matlab include and library path defined in the settings and compile. | ||
**Don't forget to add `./matlab` to your Matlab path.** | ||
|
||
### Python Wrapper | ||
|
||
Similar with Matlab, replace the python include and library path and compile. | ||
|
||
Most of the libraries listed in `./python/requirements.txt` can be installed by `pip install`. However, some of them cannot be installed so easily. | ||
|
||
For protobuf, you may download the codes from https://github.com/google/protobuf. Copy `caffe-windows-root/src/caffe/proto/protoc.exe` to `protobuf-root/src`. Then run `python setup.py install` in `protobuf-root/python`. | ||
|
||
For leveldb, I have created a repository https://github.com/happynear/py-leveldb-windows . Please follow the instructions in `README.md` to install it. | ||
|
||
### MNIST example | ||
|
||
Please download the mnist leveldb database from https://pan.baidu.com/s/1mgl9ndu and extract it to `./examples/mnist`. Then double click `./run_mnist.bat` to run the MNIST demo. | ||
|
||
## Update log | ||
|
||
2015/11/09 CuDNN v3 works well now. | ||
|
||
Python Wrapper | ||
====== | ||
Similar with Matlab, just change the python include and library path defined in the settings and compile. | ||
2015/09/14 Multi-GPU is supported now. | ||
|
||
MNIST example | ||
====== | ||
Please download the mnist leveldb database from http://pan.baidu.com/s/1mgl9ndu and extract it to ./examples/mnist. Then double click ./run_mnist.bat to run the MNIST demo. | ||
WARNING: When you are using multiple gpus to train a model, please do not directly close the command window. Instead, please use `Ctrl+C` to avoid the gpu driver from crash. | ||
|
||
Acknowlegement | ||
====== | ||
We greatly thank [Yangqing Jia](https://github.com/Yangqing) and [BVLC group](https://www.github.com/BVLC/caffe) for developing Caffe, | ||
You can also press `Ctrl+Break` to save a model snapshot whenever you want during training. | ||
|
||
[@niuzhiheng](https://github.com/niuzhiheng) for his contribution on the first generation of caffe-windows, | ||
## License and Citation | ||
|
||
[@ChenglongChen](https://github.com/ChenglongChen/batch_normalization) for his implementation of Batch Normalization, | ||
Caffe is released under the [BSD 2-Clause license](https://github.com/BVLC/caffe/blob/master/LICENSE). | ||
The BVLC reference models are released for unrestricted use. | ||
|
||
[@jackculpepper](https://github.com/jackculpepper/caffe) for his implementation of locally-connected layer, | ||
Please cite Caffe in your publications if it helps your research: | ||
|
||
and all people who have contributed to the caffe user group. | ||
@article{jia2014caffe, | ||
Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor}, | ||
Journal = {arXiv preprint arXiv:1408.5093}, | ||
Title = {Caffe: Convolutional Architecture for Fast Feature Embedding}, | ||
Year = {2014} | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.