Questions tagged [cnn]

The name “convolutional neural network” (CNN, or ConvNet) indicates that the network employs a mathematical operation called convolution. CNNs are regularized versions of [multilayer-perceptron]s. Consider using [neural-network] tag instead.

1061 questions
19
votes
6 answers

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 for 2 outputs. But now i am getting this error:: Epoch…
faiza rashid
  • 205
  • 1
  • 2
  • 7
8
votes
1 answer

Pytorch : W ParallelNative.cpp:206

I'm trying to use a pre-trained template on my image set by following the tutorial right here : https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html Only I always get this "error" when I run my code and the console…
Marcel
  • 111
  • 1
  • 4
8
votes
4 answers

Why CNN running in python is extremely slow in comparison to Matlab?

I have trained a CNN in Matlab 2019b that classifies images between three classes. When this CNN was tested in Matlab it was functioning fine and only took 10-15 seconds to classify an image. I used the exportONNXNetwork function in Maltab so that I…
Hardit Singh
  • 339
  • 2
  • 11
5
votes
1 answer

With ResNet50 the validation accuracy and loss is not changing

I am trying to do image recognition with ResNet50 in Python (keras). I tried to do the same task with VGG16, and I got some results like these (which seem okay to me): resultsVGG16 . The training and validation accuracy/loss functions are getting…
Peter Nagy
  • 53
  • 6
5
votes
1 answer

Choosing the learning_rate using fastai's learn.lr_find()

I am going over this Heroes Recognition ResNet34 notebook published on Kaggle. The author uses fastai's learn.lr_find() method to find the optimal learning rate. Plotting the loss function against the learning rate yields the following figure: It…
Sheldon
  • 1,815
  • 2
  • 9
  • 22
5
votes
1 answer

I don't understand pytorch input sizes of conv1d, conv2d

I have a data of 2 temporal series of 18 points each one. So I organized in a matrix of 18 rows and 2 columns (with 180 samples to classify in 2 classes - activated and non-activated). So, I want to do a CNN with this data, my kernel walks in one…
4
votes
1 answer

TypeError: fit_generator() got an unexpected keyword argument 'nb_val_samples'

I am trying to make a handwriting classifier by referencing the article: https://github.com/priya-dwivedi/Deep-Learning/blob/master/handwriting_recognition/English_Writer_Identification.ipynb. while fitting the model I get an error saying that the…
4
votes
1 answer

How to convert data into images without data loss

I have seen alot of papers where they convert network data into images, i am trying to do the same i got the 87 apps network data from kaggle. The data has three columns 'Source.IP', 'Destination.IP' and 'Payload' it looks like this and when I…
Waqar
  • 331
  • 2
  • 4
  • 15
4
votes
2 answers

How to interpret expand_dims while predicting a uploaded image in tensorflow

These days I am getting familiar with CNN & tensorflow (via cat/dog classification problem) and while writing the predict function, I realize that the code uses expand_dims, which I am not able to interpret [1]. When I am able to get the desired…
Violet
  • 139
  • 2
  • 12
3
votes
1 answer

Prediction gives me the same value

I'm trying to predict the next value based on the previous value for my cnn+lstm model, but I get the overall average for each prediction. My data consists of heatmap images of a neighborhood (features) for twenty weeks with the number of crimes…
3
votes
1 answer

Optuna Pytorch: returned value from the objective function cannot be cast to float

def autotune(trial): cfg= { 'device' : "cuda" if torch.cuda.is_available() else "cpu", # 'train_batch_size' : 64, # 'test_batch_size' : 1000, # 'n_epochs' : 1, # 'seed' : 0, # …
Tonz
  • 95
  • 8
3
votes
1 answer

Combining CNN and bidirectional LSTM

I am trying to combine CNN and LSTM for image classification. I tried the following code and I am getting an error. I have 4 classes on which I want to train and test. Following is the code: from keras.models import Sequential from keras.layers…
3
votes
1 answer

TypeError: "NoneType" object is not callable in Google Colab

below imported packages and models which is define to allow to access the building operations, import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import cv2 import os from tensorflow.keras.preprocessing.image import…
Imdadul Haque
  • 571
  • 1
  • 1
  • 18
3
votes
2 answers

Passing output of a CNN to BILSTM

I am working on a project in which I have to pass the output of CNN to Bi directional LSTM. I created the model as below but it is throwing 'incompatible' error. Please let me know where I am going wrong and how to fix this model =…
3
votes
0 answers

(Faster R-CNN) ROI Pooling layer is not differentiable w.r.t the box coordinates

The paper reports that "having an RoI pooling layer that is differentiable w.r.t the box coordinates is a nontrivial problem" and refers to "ROI Warping" (crops and resizes the features to a fixed shape) that makes it fully differentiable w.r.t the…
Austin
  • 31
  • 1
1
2 3
70 71