Can Caffe classify pixels of an image directly?

I would like to classify pixels of an image to "is street" or "is not street". I have some training data from the KITTI dataset and I have seen that Caffe has an IMAGE_DATA layer type. The labels...

Finding gradient of a Caffe conv-filter with regards to input

I need to find the gradient with regards to the input layer for a single convolutional filter in a convolutional neural network (CNN) as a way to visualize the filters. Given a trained network in...

How to verify CuDNN installation?

I have searched many places but ALL I get is HOW to install it, not how to verify that it is installed. I can verify my NVIDIA driver is installed, and that CUDA is installed, but I don't know how...

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int32

I get following error ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int32: 'Tensor("Placeholder_1:0", shape=TensorShape([Dimension(128), Dimension(2)]),...

Fine Tuning of GoogLeNet Model

I trained GoogLeNet model from scratch. But it didn't give me the promising results. As an alternative, I would like to do fine tuning of GoogLeNet model on my dataset. Does anyone know what are...

Changing the scale of a tensor in tensorflow

Sorry if I messed up the title, I didn't know how to phrase this. Anyways, I have a tensor of a set of values, but I want to make sure that every element in the tensor has a range from 0 - 255,...

Error: the tensor's graph is different from the session's graph

I am trying to load a previously trained tensor trained model from checkpoint files, now these checkpoint files has op varaibles in them so to load the graph I have to first load graph_def from...

How to calculate fan-in and fan-out in Xavier initialization for neural networks?

Variations I have found of the Xavier initialization for weights in a Neural Network all mention a fan-in and a fan-out; could you please tell how those two parameters are computed? Specifically...

Memory error in keras while implementing CNN

I have created the model as below(keras with theano backend). When I run it on my CPU it gives me memory error. I have 8GB DDR3 ram and before calling model1.fit my ram is 2.3 GB consumed. Also I...

Should I use the same training set from one epoch to another (convolutional neural network)

From what I know about convolutional neural networks, you must feed the same training examples each epoch, but shuffled (so the network won't remember some particular order while...

PyTorch element-wise filter layer

Hi, I want to add element-wise multiplication layer to duplicate the input to multi-channels like this figure. (So, the input size M x N and multiplication filter size M x N is same), as...

Difference between tf.layers.conv2d and tf.contrib.slim.conv2d

I'm trying to convert a network that I'm using from using tf-slim's conv2d to using tf.layers.conv2d, since it looks like tf.layers is the more supported and future-proof option. The function...

Keras Callbacks: Learnig Rate Schedular and Reduce Learning rate on plateau

I am trying to use both the LearningRateScheduler and ReduceLROnPlateau callbacks together in Keras, will it make a problem for the learning rate. If so which learning rate will the model use ? I...

Element-wise multiplication with Keras

I have a RGB image of shape (256,256,3) and I have a weight mask of shape (256,256). How do I perform the element-wise multiplication between them with Keras? (all channels share the same mask)

Conv 1x1 configuration for feature reduction

I am using 1x1 convolution in the deep network to reduce a feature x: Bx2CxHxW to BxCxHxW. I have three options: x -> Conv (1x1) -> Batchnorm-->ReLU. Code will be output = ReLU(BN(Conv(x)))....

How can I solve error "allocation exceeds 10 of system memory" on keras?

I made a CNN on Keras with Tensorflow backend, my training set has 144 examples, but each example has size of 3200*101. My CNN is very basic, just for learning, batch_size of 2 (I tried reducing...

Simple Conv Net

I'm new on pytorch and I would like your light on a small net I try to setup. class PzConv2d(nn.Module): """ Convolution 2D Layer followed by PReLU activation """ def __init__(self,...

RuntimeError: Given groups=1, weight of size 16 1 5 5, expected input[100, 3, 256, 256] to have 1 channels, but got 3 channels instead

I try to run the following programe for images classification problem in Pytorch: import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import...

Pytorch: can we use nn.Module layers directly in forward() function?

Generally, In the constructor, we declare all the layers we want to use. In the forward function, we define how the model is going to be run, from input to output. My question is what if calling...

How should \n be dealt in text while training for NER ? Should they be removed or replaced by space?

I have documents where often the ORG name will come as follows(seperated by newline): Name_Part1 Name_Part2 Name_Part3 Here, I want to training a NER model using spacy CNN. Should I be replacing...

TimeDistributed of a KerasLayer in Tensorflow 2.0

I'm trying to build a CNN + RNN using a pre-trained model from tensorflow-hub: base_model = hub.KerasLayer('https://tfhub.dev/google/imagenet/resnet_v2_50/feature_vector/4', input_shape=(244, 244,...

CNN training loss regular spikes at the end of the epoch

I am training a CNN in PyTorch with Adam and the initial learning rate is 1e-5. I have 5039 samples in my epoch and the batch size is 1. I have observed that I have a regular spike pattern of...

ValueError: Shapes (None, 1) and (None, 2) are incompatible

I am training a facial expression (angry vs happy) model. Last dense output layer was previously 1 but when i predict an image it's output was always 1 with 64 % accuracy. So i changed it to 2...

Validation Accuracy Does Not Improve in CNN

I have a CNN like AlexNet trying to predict class of the ornament. The train accuracy and loss monotonically increase and decrease respectively. But, the test accuracy fluctuates around 0.50. I've...

CNN with multiple output types

I am a newcomer to convolutional neural networks and have the following question: Is there a way to create a CNN with multiple outputs, including 10 for classification and two more for regression...

How to perform unsupervised learning on CNN

The model architecture This is the task that I am performing using this model Here is my model def create_convolution_layers(input_img): # 1st Convolutional Layer model =...

Initialise pytorch convolution layer with my own values

I want to know if there's a way to initialize pytorch convolution filter with my own values. eg, I have a tuple [-0.8423, 0.3778][-3.1070, -2.6518] and I want to initialize a 2X2 filter with these...

How to load images from folders to train a CNN in Flux library of Julia?

I am trying to write a CNN (U-Net) in Flux ML Library of Julia. However the first hurdle that I am facing is, how to load images from folder to train the model. I have searched the Internet...

ValueError: Input 0 of layer lstm is incompatible with the layer: expected ndim=3, found ndim=4. Full shape received: (None, 32, 24, 7)

I am still figuring out how to resolve this error... As I have to fixed my first layer of input shape to input_shape=(BATCH_SIZE, N_PAST, N_FEATURES) I am getting errors on any error for LSTM and...

ValueError when fitting keras model

I have the following code: from sklearn.datasets import fetch_openml import numpy as np import keras mnist = fetch_openml('mnist_784', version=1) X, y = mnist["data"], mnist["target"] y =...