Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This is the latest version of Caffe_1.0 (windows branch) with Python3.6 support, with all examples converted to bat files for easy usage

License

NotificationsYou must be signed in to change notification settings

Coderx7/Caffe_1.0_Windows

Repository files navigation

This is the latest version of Caffe for windows which has all the examples made ready for windows users. This branch also supports Python3.6 which was not supported in the official branch until now!

این آخرین نسخه کفی مبتنی بر ویندوز هست که تمامی مثالهادر اون براحتی قابل اجرا در ویندوز هستند. این نسخه برخلاف نسخه رسمی کفی در ویندوز از پایتون 3.6 هم پشتیبانی میکنه برای اطلاعات بیشترمیتونید بهنصب و پیکربندی کفی در ویندوز مراجعه کنید

نسخه های از پیش کامپایل شده رو هم میتونید از زیر دانلود کنید .اونهایی که فقط سی پی یو اونلی نوشته شدن روی هر سیستمی کار میکنند (64 بیتی البته) و نیازی به وجود کارت گرافیک نیستکسانی که کارت گرافیک انویدیا دارن میتونن از ورژن های کامپایل شده با قابلیت موازی سازی کارت گرافیک (جی پی یو-کودا) استفاده کنند.همه اطلاعات مورد نیاز در لینک آموزشی که بالا داده شده وجود داره و برای پرسش سوال و پیگیری های بعدی از همون لینک استفاده کنید.

This branch of Caffe ports the framework to Windows.

Travis Build Status Travis (Linux build)

Build statusAppVeyor (Windows build)

Prebuilt binaries | نسخه های از پیش کامپایل شده

Prebuilt binaries can be downloaded from therelease section for the following configurations:

Windows Setup

Requirements

  • Visual Studio 2013 or 2015
  • CMake 3.4 or higher (Visual Studio andNinja generators are supported)

Optional Dependencies

  • Python for the pycaffe interface. Anaconda Python 2.7, 3.5 and 3.6 x64 (or Miniconda)
  • Matlab for the matcaffe interface.
  • CUDA 7.5 or 8.0 (use CUDA 8 if using Visual Studio 2015)
  • cuDNN v5.1 or v6.0

We assume thatcmake.exe andpython.exe are on yourPATH.

Configuring and Building Caffe

The fastest method to get started with caffe on Windows is by executing the following commands in acmd prompt (we useC:\Projects as a root folder for the remainder of the instructions):

C:\Projects> git clone https://github.com/BVLC/caffe.gitC:\Projects>cd caffeC:\Projects\caffe> git checkout windows:: Edit any of the options inside build_win.cmd to suit your needsC:\Projects\caffe> scripts\build_win.cmd

Thebuild_win.cmd script will download the dependencies, create the Visual Studio project files (or the ninja build files) and build the Release configuration. By default all the required DLLs will be copied (or hard linked when possible) next to the consuming binaries. If you wish to disable this option, you can by changing the command line option-DCOPY_PREREQUISITES=0. The prebuilt libraries also provide aprependpath.bat batch script that can temporarily modify yourPATH envrionment variable to make the required DLLs available.

Below is a more complete description of some of the steps involved in building caffe.

Install the caffe dependencies

By default CMake will download and extract prebuilt dependencies for your compiler and python version. It will create a folder calledlibraries containing all the required dependencies inside your build folder. Alternatively you can build them yourself by following the instructions in thecaffe-builderREADME.

Use cuDNN

To use cuDNN the easiest way is to copy the content of thecuda folder into your CUDA toolkit installation directory. For example if you installed CUDA 8.0 and downloaded cudnn-8.0-windows10-x64-v5.1.zip you should copy the content of thecuda directory toC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0. Alternatively, you can define the CUDNN_ROOT cache variable to point to where you unpacked the cuDNN files e.g.C:/Projects/caffe/cudnn-8.0-windows10-x64-v5.1/cuda. For example the command inscripts/build_win.cmd would become:

cmake -G"!CMAKE_GENERATOR!" ^      -DBLAS=Open ^      -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^      -DBUILD_SHARED_LIBS:BOOL=%CMAKE_BUILD_SHARED_LIBS% ^      -DBUILD_python:BOOL=%BUILD_PYTHON% ^      -DBUILD_python_layer:BOOL=%BUILD_PYTHON_LAYER% ^      -DBUILD_matlab:BOOL=%BUILD_MATLAB% ^      -DCPU_ONLY:BOOL=%CPU_ONLY% ^      -DCUDNN_ROOT=C:/Projects/caffe/cudnn-8.0-windows10-x64-v5.1/cuda ^      -C "%cd%\libraries\caffe-builder-config.cmake" ^      "%~dp0\.."

Alternatively, you can opencmake-gui.exe and set the variable from there and clickGenerate.

Building only for CPU

If CUDA is not installed Caffe will default to a CPU_ONLY build. If you have CUDA installed but want a CPU only build you may use the CMake option-DCPU_ONLY=1.

Using the Python interface

The recommended Python distribution is Anaconda or Miniconda. To successfully build the python interface you need to add the following conda channels:

conda config --add channels conda-forgeconda config --add channels willyd

and install the following packages:

conda install --yes cmake ninja numpy scipy protobuf==3.1.0 six scikit-image pyyaml pydotplus graphviz

If Python is installed the default is to build the python interface and python layers. If you wish to disable the python layers or the python build use the CMake options-DBUILD_python_layer=0 and-DBUILD_python=0 respectively. In order to use the python interface you need to either add theC:\Projects\caffe\python folder to your python path of copy theC:\Projects\caffe\python\caffe folder to yoursite_packages folder.

Using the MATLAB interface

Follow the above procedure and use-DBUILD_matlab=ON. Change your current directory in MATLAB toC:\Projects\caffe\matlab and run the following command to run the tests:

>> caffe.run_tests()

If all tests pass you can test if the classification_demo works as well. First, fromC:\Projects\caffe runpython scripts\download_model_binary.py models\bvlc_reference_caffenet to download the pre-trained caffemodel from the model zoo. Then change your MATLAB directory toC:\Projects\caffe\matlab\demo and runclassification_demo.

Using the Ninja generator

You can choose to use the Ninja generator instead of Visual Studio for faster builds. To do so, change the optionset WITH_NINJA=1 in thebuild_win.cmd script. To install Ninja you can download the executable from github or install it via conda:

> conda config --add channels conda-forge> conda install ninja --yes

When working with ninja you don't have the Visual Studio solutions as ninja is more akin to make. An alternative is to useVisual Studio Code with the CMake extensions and C++ extensions.

Building a shared library

CMake can be used to build a shared library instead of the default static library. To do so follow the above procedure and use-DBUILD_SHARED_LIBS=ON. Please note however, that some tests (more specifically the solver related tests) will fail since both the test exectuable and caffe library do not share static objects contained in the protobuf library.

Troubleshooting

Should you encounter any error please post the output of the above commands by redirecting the output to a file and open a topic on thecaffe-users list mailing list.

Known issues

  • TheGPUTimer related test cases always fail on Windows. This seems to be a difference between UNIX and Windows.
  • Shared library (DLL) build will have failing tests.
  • Shared library build only works with the Ninja generator

Further Details

Refer to the BVLC/caffe master branch README for all other details such as license, citation, and so on.

About

This is the latest version of Caffe_1.0 (windows branch) with Python3.6 support, with all examples converted to bat files for easy usage

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2026 Movatter.jp