caffe

Error in Using Nvidia DIGITS trained Models in OpenCV

ⅰ亾dé卋堺 提交于 2020-01-05 05:31:04
问题 I Trained my model using DIGITS ( NVCaffe) and I use it in opencv similar to opencv example that use .prototxt & .caffemodel and i tested it and work good. But when I use Models that trained by digits i got this error: OpenCV Error: Assertion failed (pbBlob.raw_data_type() == caffe::FLOAT16) in blobFromProto, file /opt/opencv/modules/dnn/src/caffe/caffe_importer.cpp, line 242 Exception: /opt/opencv/modules/dnn/src/caffe/caffe_importer.cpp:242: error: (-215) pbBlob.raw_data_type() == caffe:

What's the difference between convolution in Keras vs Caffe?

丶灬走出姿态 提交于 2020-01-05 04:38:06
问题 I'm trying to replicate a large Caffe network into Keras (based on tensorflow backend). But I'm having a large trouble doing it even at a single convolutional layer. Simple Convolution in General : Let's say we had a 4D input with shape (1, 500, 500, 3) , and we had to perform a single convolution on this input with 96 filters with kernel size of 11 and 4x4 strides. Let's set our weight and input variables: w = np.random.rand(11, 11, 3, 96) # weights 1 b = np.random.rand(96) # weights 2 (bias

LNK1104 Visual studio 2015

倖福魔咒の 提交于 2020-01-05 04:06:12
问题 I am trying to build Caffe Deep Learning Network solution using Windows and I have literally tried everything to make it work. I found similar questions, but they were using VS 2010 or 2013 and I don't have any of the options listed in most of the answers. Firstly: I am using VS 2015, cudNN and latest Caffe, and I am trying to build it using Windows x64. Secondly: I have tried two approaches (started off with adding cudNN path in both cases) 1) Reference: http://embedonix.com/articles/machine

How to train ResNet101 model from scratch in Caffe?

孤人 提交于 2020-01-05 00:48:41
问题 I'm using the DeepLab_v2 version of Caffe in order to do semantic segmentation. I can finetune the ResNet101 using imagenet model, but I cannot train the model from scratch using custom data. Did anyone have similar experience and managed to solve this issue? This is how a functional block of the ResNet looks like, that I'm currently using for training: layer { bottom: "data" top: "conv1" name: "conv1" type: "Convolution" param { name: "conv1_0" lr_mult: 1 decay_mult: 1 } convolution_param {

Caffe: How to get `solver.prototxt` parameters by code?

点点圈 提交于 2020-01-04 03:18:07
问题 I want to access the solver.prototxt parameters such as base_lr (Base Learning Rate) or weight_decay from python code. is there any way to access these from the solver.net object ? Thank you 回答1: According to this tutorial, you can access it by : ### define solver from caffe.proto import caffe_pb2 s = caffe_pb2.SolverParameter() # Set a seed for reproducible experiments: # this controls for randomization in training. s.random_seed = 0xCAFFE # Specify locations of the train and (maybe) test

Caffe model gives same output for every image

心不动则不痛 提交于 2020-01-04 02:30:38
问题 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 snippet net=caffe.Net('alexnet/train_val.prototxt','alexnet/bvlc_alexnet.caffemodel',caffe.TEST) for image in images: im = np.array(caffe.io.load_image(image)) im = caffe.io.resize_image(im, (227, 227)) im = np.array(im,dtype=np.float32) im =255*im; im = im[:,:,::-1] im -= np.array(((104.00698793,116.66876762,122

Is there a common format for neural networks

瘦欲@ 提交于 2020-01-03 07:17:33
问题 Different teams use different libraries to train and run neural networks (caffe, torch, theano...). This makes sharing difficult: each library has its own format to store networks and you have to install a new library each time you want to test other teams' work. I am looking for solutions to make this less tedious: - Is there a preferred (shared?) format to store neural networks? - Is there a service or library that can help handle different types of networks / or transform one type into

net surgery on a custom caffe model

心已入冬 提交于 2020-01-03 00:57:10
问题 I'm trying to modify the weights of a caffemodel which is part of a caffe-branch called Deep Lab. Although there is a tutorial on how to do net surgery, when I try to do the same with my custom caffemodel the python kernel dies always on the following line: # Load the original network and extract the fully connected layers' parameters. net = caffe.Net('../models/deeplab/train.prototxt', '../models/deeplab/train.caffemodel', caffe.TRAIN) I think its because pycaffe doesn't know their custom

How to split a Blob along channels in Caffe

倖福魔咒の 提交于 2020-01-01 09:57:14
问题 I would like to split the Blob channels in Caffe, so that I can split one Blob of (N, c, w, h) into two output Blobs of size (N, c/2, w, h) . What I have described above is very general, what I want to do actually is to separate a two-channel input image into two different images. One goes to a convolutional layer and the other goes to a pooling layer. Finally, I concatenate the outputs. So I am wondering if a Caffe layer that allows the user to do such thing exists, and how to define it in

How to convert Mat from opencv to caffe format

孤者浪人 提交于 2020-01-01 06:53:32
问题 I am using opencv to crop face from my camera. And then I used caffe to predict that image belongs to male or female. I have a original code that load image from static image. However, I want to use image from camera for it. This is original code in caffe model = caffe.Classifier(...) image_path = './static_image.jpg' input_image = caffe.io.load_image(image_path ) prediction =model.predict([input_image]) Now, I will use opencv to capture frame and call predict method val, image = cap.read()