Coder Social home page Coder Social logo

longjon / caffe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bvlc/caffe

81.0 23.0 43.0 39.07 MB

Caffe

Home Page: http://daggerfs.com/caffe/

License: Other

Shell 0.40% C++ 80.31% MATLAB 0.98% Python 8.52% Cuda 4.61% CMake 3.01% Makefile 0.68% Protocol Buffer 1.50% M 0.01%

caffe's Introduction

DO NOT USE THIS BRANCH---IT IS DEPRECATED

See the fcn.berkeleyvision.org repo for details, reference models, and code.

This was a pre-release Caffe branch for fully convolutional networks (FCNs); however, the needed FCN features are now included in the Caffe master branch. Note however there are differences in the master edition, so refer to the documentation there.

This includes unmerged PRs and no guarantees. Everything here is subject to change, including the history of this branch. Consider PR #2016 for reducing memory usage.

See future.sh for details.

caffe's People

Contributors

arntanguy avatar chyojn avatar cnikolaou avatar cypof avatar dgolden1 avatar erictzeng avatar flx42 avatar jamt9000 avatar jeffdonahue avatar jyegerlehner avatar kloudkl avatar longjon avatar lukeyeager avatar mavenlin avatar mohomran avatar mtamburrano avatar netheril96 avatar philkr avatar pluskid avatar qipeng avatar rbgirshick avatar ronghanghu avatar sergeyk avatar sguada avatar shelhamer avatar ste-m5s avatar tdomhan avatar tnarihi avatar yangqing avatar yosinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe's Issues

loss when fcn converges

Hi,

I tried to build me own fcn, but it seems that loss I can get after fine tune is still around 1.1k for 512X384 images. So could anyone tell me the loss you got when the cnn converges?

Many thanks.

mnist examples not running and tests fail

I have installed this FCN branch of caffe. There is no issue in make and make test but make runtest fails for some tests in SGDsolver. I commented those tests and rests are running.
Also, when I do examples/mnist/train_mnist_autoencoder_adagrad.sh, it gets hanged and doesn't proceed beyond
I0102 18:03:51.671083 3065 layer_factory.hpp:76] Creating layer data
I0102 18:03:51.671159 3065 net.cpp:111] Creating Layer data
I0102 18:03:51.671169 3065 net.cpp:434] data -> data
I have figured out where it is stopping. In net.cpp at line 153,
layers_[layer_id]->SetUp(bottom_vecs_[layer_id], top_vecs_[layer_id]);
is being executed which calls Setup in layer.hpp line 71
void SetUp(const vector<Blob>& bottom,
const vector<Blob
>& top)

In this function, I can't find it proceeding beyond line 75 which is
LayerSetUp(bottom, top);
Apparently LayerSetup is a virtual function, but I couldn't find it's implementation. When I comment this line, it breaks at the next line in Reshape..
F0102 18:12:52.731317 3652 split_layer.cpp:22] Check failed: count_ == top[i]->count() (0 vs. 1)

Also, I have a K40C GPU and CUDA-6.5 on which I am running the master branch caffe.

Failed to run eval.py of FCN-32S

I have just tried to run the eval.py using FCN-32s model. But I get the following error

F1105 19:29:04.896656 25800 layer_factory.hpp:77] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Crop (known types: AbsVal, Accuracy, ArgMax, BNLL, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, Eltwise, EuclideanLoss, Exp, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, LRN, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Pooling, Power, Python, ReLU, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, WindowData)
*** Check failure stack trace: ***
Aborted (core dumped)

which says that the Crop is an unknown layer type. I have no idea of what is going wrong. Could anyone give me some suggestions?

BTW, I use the required caffe-future brach: I download and unzip caffe-future.zip. Then I copy the Makefile.config from caffe-master to it and successfully run make all and make pycaffe.

Error in crop_layer.cpp

When I train FCN 32s for my own dataset ,i get the following error ,

(2 vs 3)
invalid crop parameters in dimension: 1

It points to line number 69 here

This is happening at the crop layer.I cant understand this error.I resized all input images to 500x500(3 channel ) and labels are in 1xHxW and only two classes with 0 as background and 255 as foreground.

When will such an error occur.I cannot understand the use of crop layer after deconvolution layer as well.Am i doing some mistake here,do I need to mention the crop_offset myself?

Problems building on ubuntu 14.04

Hi Everyone,

I am having trouble building this version of caffe. I am however able to build caffe master branch just fine.
I am running ubuntu 14.04, using anaconda and am trying to build the CPU only version.
So far I have:

git clone https://github.com/longjon/caffe.git
cd caffe
git checkout future

Adjusted my make file:

## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
 CPU_ONLY := 1

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
        -gencode arch=compute_20,code=sm_21 \
        -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_50,code=compute_50

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
#PYTHON_INCLUDE := /usr/include/python2.7 \
        /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := $(HOME)/anaconda2
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
        # $(ANACONDA_HOME)/include/python2.7 \
        # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# We need to be able to find libpythonX.X.so or .dylib.
#PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @

I have also exported the correct PYTHONPATH and also modified my CPLUS_INCLUDE_PATH so that g++ can find pyconfig.h

export PYTHONPATH="/home/Data Science Bowl/caffe/python:$PYTHONPATH"
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/home/durhamsmith/anaconda2/include/python2.7/"

However when I try to make all i get the following

PROTOC src/caffe/proto/caffe.proto
CXX src/caffe/layer.cpp
CXX src/caffe/data_reader.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/blocking_queue.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/db_lmdb.cpp
CXX src/caffe/util/upgrade_proto.cpp
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/net.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/common.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/reduction_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/layers/crop_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/mvn_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/tile_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/embed_layer.cpp
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/spp_layer.cpp
CXX src/caffe/layers/log_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/blob.cpp
CXX src/caffe/internal_thread.cpp
CXX tools/train_net.cpp
CXX tools/extract_features.cpp
CXX tools/test_net.cpp
CXX tools/compute_image_mean.cpp
CXX tools/caffe.cpp
CXX tools/finetune_net.cpp
CXX tools/convert_imageset.cpp
CXX tools/upgrade_net_proto_text.cpp
CXX tools/net_speed_benchmark.cpp
CXX tools/upgrade_net_proto_binary.cpp
CXX tools/device_query.cpp
CXX examples/mnist/convert_mnist_data.cpp
CXX examples/cpp_classification/classification.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX examples/cifar10/convert_cifar_data.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/train_net.bin
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/finetune_net.bin
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX/LD -o .build_release/tools/device_query.bin
ln: target ‘.build_release/tools/train_net’ is not a directory
make: *** [.build_release/tools/train_net] Error 1

Does anyone know how to fix this issue?

How to evaluate the fcn-32 pascal caffemodel?

when I want to evaluate this given caffemodel : fcn-32s pascal, you gives a mean I/U 64.0. But I tried several times, I can not get the same value. I tried the follow ways:

  1. resize the test image to 500 x 500, and resize the groundtruth to 500 x 500 too, then I got mean I/U 64.3
  2. resize the test image to 500 x 500, and get the predict result with size 500 x 500, then I crop it to the size of original image, then got the mean I/U 64.5
  3. keep the size of image, and input it directly(reshape the caffemodel's input layer), get the predict image of original size, then got the mean I/U 64.9
    so my question is, how to process the image to get the right mean I/U 64.0, or is there code to get it by the author?
    what's more, I test it on seg11valid.
    can you help me, thank you.

Does this support cuDNN v4?

I would like to know does this repo supports cuDNN v4 as I am getting some errors as below

20 errors detected in the compilation of "/tmp/tmpxft_0000218a_00000000-16_cudnn_conv_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/cudnn_conv_layer.o] Error 1

k-channel implementation

My dataset has 2 classes; with 1000 training images of (5,256,256) also corresponding ground truth data (1,256,256) which is a binary image either 0 or 1 to represent the 2 classes.

In FCN-32 https://gist.github.com/shelhamer/80667189b218ad570e82 when training in solve.py you use the existing caffemodel which I assume is 3-channel ; but as I want to implement in on my 5 channel dataset can I use the same model provided ?

Unable to install caffe-future.

Hi,

I found out about Caffe-future from the paper Fully Convolutional Neural Networks (found the link from model-zoo). I am trying to work on a regression problem where the input to the CNN is an 256 X 256 image and the output that the CNN is supposed to produce is also an 256 X 256 image. So a version of caffe that supports Fully convolutional neural netwroks would be extremely useful for me. In the original version of caffe I was getting an error when I tried setting the stride of the convolutional layer to a float value (for upsampling). I believe the caffe-future version supports float value for stride.

However, while trying to install caffe-future I am facing some issues. I am not sure if I am missing anything. Following is what I tried for installation:

First I cloned the git repository. After that I followed the instructions mentioned in future.sh
Mentioned below are the commands I wrote and the outputs I got. The main issue I faced was in the command : hub merge BVLC#1977 which gave the error : fatal: Couldn't find remote ref refs/heads/accum-grad

>>> git clone https://github.com/longjon/caffe.git
>>> cd caffe

>>> git checkout master

Already on 'master'
Your branch is up-to-date with 'origin/master'.

>>> git branch -D future

error: branch 'future' not found.

>>> git checkout -b future

Switched to a new branch 'future'

>>> hub merge https://github.com/BVLC/caffe/pull/1976

include/caffe/util/benchmark.hpp | 27 +-
include/caffe/util/coords.hpp | 61 +
include/caffe/util/cudnn.hpp | 128 +
include/caffe/util/db.hpp | 190 ++
include/caffe/util/device_alternate.hpp | 102 +
include/caffe/util/im2col.hpp | 22 +-
...
...
...
matlab/caffe/matcaffe_init.m | 11 +-
.../bvlc_alexnet/deploy.prototxt | 248 +-
models/bvlc_alexnet/readme.md | 25 +
.../bvlc_alexnet/solver.prototxt | 6 +-
.../bvlc_alexnet/train_val.prototxt | 296 ++-
models/bvlc_googlenet/deploy.prototxt | 2156 +++++++++++++++++
...
...
...
tools/test_net.cpp | 54 +-
tools/train_net.cpp | 34 +-
tools/upgrade_net_proto_binary.cpp | 17 +-
tools/upgrade_net_proto_text.cpp | 29 +-
430 files changed, 46179 insertions(+), 11932 deletions(-)
create mode 100644 .Doxyfile
create mode 100644 .travis.yml
create mode 100644 CMakeLists.txt
create mode 100644 cmake/ConfigGen.cmake
create mode 100644 cmake/Cuda.cmake
create mode 100644 cmake/Dependencies.cmake
...
...
...
create mode 100644 src/caffe/util/db.cpp
create mode 100644 src/gtest/CMakeLists.txt
create mode 100644 tools/CMakeLists.txt
create mode 100644 tools/caffe.cpp
delete mode 100644 tools/dump_network.cpp
create mode 100755 tools/extra/parse_log.py

>>> hub merge https://github.com/BVLC/caffe/pull/1977

fatal: Couldn't find remote ref refs/heads/accum-grad

>>> hub merge https://github.com/BVLC/caffe/pull/2086

From git://github.com/longjon/caffe
[new branch] python-net-spec -> longjon/python-net-spec
Auto-merging src/caffe/net.cpp
Removing src/caffe/layers/flatten_layer.cu
Auto-merging matlab/hdf5creation/demo.m
Removing matlab/caffe/read_cell.m
Removing matlab/caffe/print_cell.m
Removing matlab/caffe/prepare_batch.m
Removing matlab/caffe/matcaffe_init.m
Removing matlab/caffe/matcaffe_demo_vgg_mean_pix.m
Removing matlab/caffe/matcaffe_demo_vgg.m
Removing matlab/caffe/matcaffe_demo.m
Removing matlab/caffe/matcaffe_batch.m
Removing matlab/caffe/matcaffe.cpp
Removing matlab/caffe/ilsvrc_2012_mean.mat
Auto-merging include/caffe/vision_layers.hpp
CONFLICT (content): Merge conflict in include/caffe/vision_layers.hpp
Auto-merging include/caffe/neuron_layers.hpp
Auto-merging include/caffe/layer.hpp
Auto-merging include/caffe/common_layers.hpp
Auto-merging examples/net_surgery/bvlc_caffenet_full_conv.prototxt
Automatic merge failed; fix conflicts and then commit the result.

I am unable to compile caffe. Can someone please help me with this issue ?

Repeated loss of 3.04452

Trying to use the FCN-Alexnet with the future branch. We get the same loss output with with different datasets, different input types etc. Have tried for 12,000 iterations with no change in the loss. Unsure as to what could be causing this. We get the exact same number every time.

Visualize Results?

Hi,
I was curious how one actually visualizes the output of the net in the same fashion that you do with your paper?

Please let me know if you have any insight.

Thank you,
Michael

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.