Skip to content

ahx-code/install-caffe-macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT macOS CMake Python OpenCV Caffe

Caffe Installation Instructions for CPU, Python 3, OpenCV 4

Make sure you've downloaded caffe-master

Open the CMakeList.txt

Compile Caffe from CMakeList 🖥️

We will be modifying the following lines:

  1. Set CPU_ONLY mode on
caffe_option(CPU_ONLY  "Build Caffe without CUDA support" ON)
  1. Add C++11 standard
if(UNIX OR APPLE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11")
endif()
  1. Set Python 3
set(python_version "3" CACHE STRING "Specify which Python version to use")

Optional 👤

  1. Doxygen

DeFacto standard tool for generating the documentation

brew install doxygen
  1. MATLAB

Set MATLAB Build ON

caffe_option(BUILD_matlab "Build Matlab wrapper" ON IF UNIX OR APPLE)

Then set the following directories:

alt_text

Compilation 🖲️

  1. Set the directories

alt_text

  1. Make sure both configureaation and Generation executed successfully

alt_text

  1. Go to the build directory
make all -j4

alt_text

  1. Install the libraries
make install

alt_text

  1. Run test
make runtest

alt_text

CV_LOAD_IMAGE_COLOR Error ‼️

If OpenCV Version 4 is installed on your system, you might encountered the following problems:

alt_text alt_text alt_text

Solution 🤔

change the followings:

 CV_LOAD_IMAGE_COLOR     -> cv::IMREAD_COLOR 
 CV_LOAD_IMAGE_GRAYSACLE -> cv::IMREAD_GRAYSCALE

Source

Below are the changed Links:

Download the link Paste in the path
io.cpp caffe-master/src/caffe/util/
test_io.cpp caffe-master/src/caffe/test/
window_data_layer.cpp caffe-master/src/caffe/layers/

Contributing 💭

Pull requests are welcome.

For major changes, please open an issue, then discuss what you would like to change.

License 📜

MIT

About

Caffe Deep Learning Framework CPU installation with Python 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages