Questions tagged [pycaffe]

The Python interface – pycaffe – is the caffe module and its scripts in caffe/python.

Pycaffe is a Python-based library which has been developed over at UC Berkeley Vision and Learning Center (BVLC). It offers high performance and modularity for implementing [deep] models.

Useful Links:

523 questions
3
votes
1 answer

caffe loss error: Check failed: The data and label should have the same first dimension

Here is my blob shapes and layers: -------------------------------- blobs data 4096 4.10e+03 (1, 2, 1, 2048) Convolution1 32736 3.27e+04 (1, 16, 1, 2046) ReLU1 32736 …
3
votes
1 answer

caffe python: implementing a residual layer

I am trying to implement a residual layer for CNN (using caffe and python). This is a simple block diagram for residual learning: This is the code I've written: def res(self,bottom,args): 'residual layer' rp = {'negative_slope': 0} …
Nima
  • 433
  • 2
  • 8
3
votes
1 answer

No module found

I install caffe and it worked fine. In cmd, I can import it use python, but when I use jupyter notebook, I can't import it. How can I solve it?
KAIYUAN ZHNAG
  • 31
  • 1
  • 1
  • 2
3
votes
0 answers

Caffe Solver.step() inside a loop

I am trying to fine tune a pre trained model with caffe. I have 1200 training samples, and 300 development set samples. (small numbers for question simplicity). I divided the Train into 100 mini-batches each has 12 samples, and the Dev into 100…
Fadwa
  • 1,717
  • 5
  • 26
  • 43
3
votes
1 answer

when defining network using caffe.NetSpec(), Is there a way to "append" from a given prototxt?

I know that one can (programmably) design a network using caffe.Netspec(), and basically the main purpose is to write its prototxt. net = caffe.NetSpec() .. (define) .. with open('my_network.prototoxt', 'w') as f: print(net.to_proto(),…
YW P Kwon
  • 2,138
  • 5
  • 23
  • 39
3
votes
2 answers

Reading network parameters from caffe .prototxt model definition in Python

I would like to read out the network parameters from a caffe network defined in a .prototxt in Python, as the layer object in the layer_dict only tell me e.g. that its a "Convolution" layer, but not things like kernel_size, strides etc. that are…
Jarno
  • 6,243
  • 3
  • 42
  • 57
3
votes
1 answer

Adding a custom python layer in caffe2

Adding a python layer in caffe was fairly straightforward (creating a child class that inherits from caffe.layer and adding four basic methods, as described here and here. However, adding a custom python layer in caffe2 is not as straightforward to…
Feynman27
  • 3,049
  • 6
  • 30
  • 39
3
votes
1 answer

Caffe's transformer.preprocessing takes too long to complete

I wrote a simple script to test a model using PyCaffe, but I noticed it is extremely slow! even on GPU! My test set has 82K samples of size 256x256 and when I ran the code which is given below, it takes hours to complete. I even used batches of…
Hossein
  • 24,202
  • 35
  • 119
  • 224
3
votes
1 answer

InfoGainLoss leads to accuracy and loss of 0

I'm trying to train a Net for semantic segmentation with class imbalance. To account for this, i tried to implement the InfoGainLoss layer and specified the infogain_matrix as was posted here, where I instead used 1- frequency(class) for each…
3
votes
0 answers

Caffe vs Tensorflow Deconv Results

I'm converting an autoencoder model from Caffe to TensorFlow. After transferring the weights, the network performs as expected through the convolutions until it reaches the deconvolutions. The output feature maps are different than expected with the…
Sam P
  • 1,821
  • 13
  • 26
3
votes
0 answers

Caffe model gives same output for every image

I just loaded alexnet in caffe using predefined prototxt and caffemodel files. However sending any image to the model returns the same value as output of fc7 layer. Here is the code…
Harjatin
  • 1,313
  • 1
  • 12
  • 22
3
votes
1 answer

Getting pycaffe layer name or blob type

I have some CNN called net for which I'd like to know the type of the blob or the name of the layer. For example, I can easily access the blob name and the subsequent blob: for blob in net.blobs: print(blob) net.blobs[blob]... Or, I can…
Shaun Barney
  • 718
  • 10
  • 24
3
votes
1 answer

Fixing a subset of weights in Neural network during training

I am considering creating a customized neural network. The basic structure is the same as usual, but I want to truncate the connections between layers. For example, if I construct a network with two hidden layers, I would like to delete some weights…
Yuan
  • 65
  • 7
3
votes
1 answer

How to design a CNN (the inputs and outputs of the layers)?

I am a beginner and learning deep learning with baby steps. I have a question about designing the nets. I see in the papers, there are layers with different inputs/outputs and I do not know how to calculate/design before implementation. For…
S.EB
  • 1,966
  • 4
  • 29
  • 54
3
votes
3 answers

How to install caffe for python3 in ubuntu

I followed the steps on caffe and changed the configure file: PYTHON_LIBRARIES := boost_python3 python3.5m PYTHON_INCLUDE := /usr/include/python3.5m \ /usr/lib/python2.7/dist-packages/numpy/core/include" INCLUDE_DIRS :=…
nsknsl
  • 147
  • 2
  • 11