conv-neural-network

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

In what ways are the output of neural network layers useful?

假如想象 提交于 2020-01-04 07:25:07
问题 I'm currently working with keras and want to visualize the output of each layer. When having a visualisation of a layer of a neural networks output, like the example below, which is for MNIST handwriting number recognition. What information or insight does a researcher gain from these images How are these images interpreted If you would choose to see the output of a layer, what are your criteria for selection? Any comment or suggestion is greatly appreciated. Thank you. 回答1: Preface: A

the usage or API of tf.app.flags

送分小仙女□ 提交于 2020-01-04 07:04:43
问题 When reading the cifar10 example, I can see the following code segment, which is said to follow the google commandline standard. But in specific, what does this code segment do? I did not find the API document to cover something like tf.app.flags.DEFINE_string FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('train_dir', '/tmp/cifar10_train', """Directory where to write event logs """ """and checkpoint.""") tf.app.flags.DEFINE_integer('max_steps', 1000000, """Number of batches to run."""

the usage or API of tf.app.flags

女生的网名这么多〃 提交于 2020-01-04 07:03:58
问题 When reading the cifar10 example, I can see the following code segment, which is said to follow the google commandline standard. But in specific, what does this code segment do? I did not find the API document to cover something like tf.app.flags.DEFINE_string FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('train_dir', '/tmp/cifar10_train', """Directory where to write event logs """ """and checkpoint.""") tf.app.flags.DEFINE_integer('max_steps', 1000000, """Number of batches to run."""

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

Training in batches but testing individual data item in Tensorflow?

半世苍凉 提交于 2020-01-03 16:46:59
问题 I have trained a convolution neural network with batch size of 10. However when testing, I want to predict the classification for each dataset separately and not in batches, this gives error: Assign requires shapes of both tensors to match. lhs shape= [1,3] rhs shape= [10,3] I understand 10 refers to batch_size and 3 is the number of classes that I am classifying into. Can we not train using batches and test individually? Update: Training Phase: batch_size=10 classes=3 #vlimit is some

Object detection using environment

血红的双手。 提交于 2020-01-03 11:37:21
问题 I'd like to ask a general question about DNN based object detection algorithms such as Yolo, SSD or R-CNN. Assume I'd like to detect mobile phones on small images, where - consequently - the mobile devices themselves are super small, moreover, it's nearly impossible to detect them by only looking at those pixels which they appear on. For instance, looking at a 300x300 image, the mobile shows up on a 7x5 grid, so only by looking at the 7x5 picture no one can surely decide what can be seen

Is there a workaround for running out of memory on GPU with tensorflow?

若如初见. 提交于 2020-01-03 10:45:10
问题 I am currently building a 3d convolutional network, for video classification. The main problem is that I run out of memory too easily. Even if I set my batch_size to 1, there is still not enough memory to train my CNN the way I want. I am using a GTX 970 with 4Gb of VRAM (3.2Gb free to use by tensorflow). I was expecting it to still train my network, maybe using my RAM memory as a backup, or doing the calculations in parts. But until now I could only run it making the CNN simpler, which

ConvNet with missing output data for weather forecast

一世执手 提交于 2020-01-03 03:17:04
问题 I am using ConvNets to build a model to make weather forecast. My input data is 10K samples of a 96x144 matrix (which represents a geographic region) with values of a variable Z (geopotential height) in each point of the grid at a fixed height. If I include 3 different heights (Z is very different in different heights) then I have this input shape: (num_samples,96,144,3). The samples are for every hour, one sample = one hour. I have nearly 2 years of data. And the input data (Z) represents

AttributeError: 'list' object has no attribute 'set_model'

我与影子孤独终老i 提交于 2020-01-02 18:38:31
问题 I'm trying to use early stopping and Model check points to save the best model while training a deep convolution neural network. However, I get the following error: callback.set_model(model) AttributeError: 'list' object has no attribute 'set_model' My code so far is: model = Sequential() ###First block model.add(Conv2D(100,kernel_size = (3,3),activation = 'relu',padding = 'same',input_shape=(12,11,1))) model.add(Conv2D(100,kernel_size = (3,3),activation = 'relu',padding = 'same')) model.add