Git Product home page Git Product logo

duruyao / caffe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bvlc/caffe

0.0 0.0 0.0 40.34 MB

Using the https://github.com/BVLC/caffe with Python 3, OpenCV 4, CUDA 11.X and cuDNN 8.

Home Page: http://caffe.berkeleyvision.org/

License: Other

Shell 0.49% C++ 80.65% Python 9.15% MATLAB 0.88% Cuda 5.95% CMake 2.74% Dockerfile 0.14%
caffe cuda11 cudnn8 docker nvidia-docker opencv4 python3 ubuntu2204

caffe's Introduction

Caffe

The current repository is forked from BVLC/caffe and updated to accommodate Python 3, OpenCV 4, CUDA 11.X and cuDNN 8.

Use Caffe with Docker

It is recommended to pull the Docker image duruyao/caffe with the updated Caffe built-in instead of the Docker image bvlc/caffe.

docker pull duruyao/caffe:cpu
docker pull duruyao/caffe:gpu

The following table lists some major differences between my own Docker image and the official Docker image.

bvlc/caffe duruyao/caffe
ubuntu 16.04 ubuntu 22.04
cuda 8.0 cuda 11.8.0
cudnn 6 cudnn 8
python 2 python 3
opencv 3 opencv 4

Install Caffe from Source

Here is an example of building Caffe for Ubuntu 22.04.

sudo apt-get update && apt-get install -y --no-install-recommends \
  build-essential \
  cmake \
  git \
  wget \
  libatlas-base-dev \
  libboost-all-dev \
  libgflags-dev \
  libgoogle-glog-dev \
  libhdf5-serial-dev \
  libleveldb-dev \
  liblmdb-dev \
  libopencv-dev \
  libprotobuf-dev \
  libsnappy-dev \
  protobuf-compiler \
  python3-dev \
  python3-numpy \
  python3-pip \
  python3-setuptools \
  python3-scipy

CAFFE_VERSION="v1.0.1"
CAFFE_SOURCE_DIR="caffe"
CAFFE_BUILD_DIR="caffe/build"
CAFFE_INSTALL_PREFIX="/opt/caffe"
git clone --branch "${CAFFE_VERSION}" --depth 1 https://github.com/duruyao/caffe.git "${CAFFE_SOURCE_DIR}"
for req in $(cat "${CAFFE_SOURCE_DIR}"/python/requirements.txt) pydot; do pip3 install --upgrade --no-cache-dir "${req}"; done
cmake -S "${CAFFE_SOURCE_DIR}" \
  -B "${CAFFE_BUILD_DIR}" \
  -G "Unix Makefiles" \
  -D CMAKE_CXX_STANDARD=11 \
  -D CMAKE_BUILD_TYPE=Release \
  -D CMAKE_INSTALL_PREFIX="${CAFFE_INSTALL_PREFIX}" \
  -D CPU_ONLY=OFF \
  -D USE_CUDNN=ON \
  -D USE_NCCL=OFF \
  -D BUILD_SHARED_LIBS=ON \
  -D BUILD_python=ON \
  -D python_version=3 \
  -D BUILD_matlab=OFF \
  -D BUILD_docs=ON \
  -D BUILD_python_layer=ON \
  -D USE_OPENCV=ON \
  -D USE_LEVELDB=ON \
  -D USE_LMDB=ON \
  -D ALLOW_LMDB_NOLOCK=OFF \
  -D USE_OPENMP=OFF
cmake --build "${CAFFE_BUILD_DIR}" --target all -- -j $(($(nproc) - 2))
cmake --build "${CAFFE_BUILD_DIR}" --target runtest -- -j $(($(nproc) - 2))
cmake --build "${CAFFE_BUILD_DIR}" --target install

export PYTHONPATH="${CAFFE_INSTALL_PREFIX}/python:${PYTHONPATH}"
export PATH="${CAFFE_INSTALL_PREFIX}/bin:${CAFFE_INSTALL_PREFIX}/python:${PATH}"
echo "${CAFFE_INSTALL_PREFIX}/lib" >>/etc/ld.so.conf.d/caffe.conf && ldconfig

More

For more information about Caffe, visit the official website caffe.berkeleyvision.org and the original repository BVLC/caffe please.

caffe's People

Contributors

shelhamer avatar jeffdonahue avatar yangqing avatar longjon avatar sguada avatar kloudkl avatar sergeyk avatar ronghanghu avatar noiredd avatar lukeyeager avatar qipeng avatar cypof avatar flx42 avatar rbgirshick avatar philkr avatar cdluminate avatar eelstork avatar dgolden1 avatar mavenlin avatar jamt9000 avatar erictzeng avatar tnarihi avatar duruyao avatar yosinski avatar blgene avatar mohomran avatar willyd avatar nitnelave avatar jyegerlehner avatar williford avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.