Questions tagged [vgg-net]

A kind of convolutional neural network consisting of 16 or 19 layers, often used with weights pre-trained on ImageNet dataset. Whereas the the model was originally created for image classification, its convolutional part can be used for a variety of purposes. Use this tag for questions, specific for this CNN architecture.

The name VGG stands for Visual Geometry Group (Oxford University), authors of the original paper.

The model consists of a convolutional part (several convolution and max- or avegare-pooling layers) and several fully-connected layers atop of it. Small (3x3) convolution filters are used.

See visual representation below (taken from this answer):

enter image description here

Model applications

  1. Image classifier (Tensorflow).
  2. Image segmentation (Keras).
  3. Image style transfer (Keras).
471 questions
0
votes
1 answer

How to add customm layers inside vgg16 when doing transfer learning?

I am trying to use transfer learning using vgg16. My main concept is to train the first few layers of vgg16, and add my own layer, afterwords add the rest of the layers from vgg16, and add my own output layer to the end. To do this I follow this…
0
votes
1 answer

How to replace the input channel shape from (224, 224, 3) to (224, 224, 1) in VGG16?

I am using VGG16 for transfer learning. My images are grayscale. So, I need to change the input channel shape of Vgg16 from (224, 224, 3) to (224, 224, 1). I tried the following code and got error: TypeError: build() takes from 1 to 2 positional…
0
votes
1 answer

keras copying VGG16 pretrained weights layer by layer

I want to copy some of the VGG16 layer weights layer by layer to another small network with alike layers, but I get an error that says: File "/home/d/Desktop/s/copyweights.py", line 78, in list(f["model_weights"].keys()) File…
dusa
  • 840
  • 3
  • 14
  • 31
0
votes
1 answer

ValueError: Error when checking input: expected input_2 to have shape (224, 224, 3) but got array with shape (224, 224, 4)

I've taken the input from the folder and then reshaped it accordingly as per the model VGG16-places365. It is still showing the same error and looked into the Keras documentation of the problem (https://keras.io/applications/#vgg16) yet the error…
Strayhorn
  • 687
  • 6
  • 16
0
votes
0 answers

Keras Transfer Learning Issue

I have trained & saved a smaller network on my small dataset, and I want to use transfer learning. I want to use this saved network on top of the conv part of the pretrained VGG16, specifically I want to freeze some layers of VGG but not all then I…
dusa
  • 840
  • 3
  • 14
  • 31
0
votes
1 answer

The training loss of vgg16 implemented in pytorch does not decrease

I want to try some toy examples in pytorch, but the training loss does not decrease in the training. Some info is provided here: The model is vgg16, consisted of 13 conv layers and 3 dense layers. The data is cifar100 in pytorch. I choose cross…
david
  • 842
  • 2
  • 8
  • 25
0
votes
1 answer

Conversion from VGG19 to ResNet in Keras

I have the following code which works on pre-trained VGG model but fails on ResNet and Inception model. vgg_model = keras.applications.vgg16.VGG16(weights='imagenet') type(vgg_model) vgg_model.summary() model = Sequential() for layer in…
Karan Arya
  • 104
  • 8
0
votes
1 answer

Unable to implement the multi class transfer learning using VGG16 pre-trained model

I am trying to re-implement the transfer learning from this link, I wanted to reimplement the code for the multiclass classification of my data. My sample data is at https://www.dropbox.com/s/esirpr6q1lsdsms/ricetransfer1.zip?dl=0 I have tried the…
0
votes
1 answer

How to solve "TypeError: unsupported operand type(s) for +: 'int' and 'str'" when loading weights into VGG16 model

I am trying to reconstruct a pretrained VGG16 model from adrianalbert's GitHub page (https://github.com/adrianalbert/urban-environments). However, the code seems to be written for an old version of Keras, leading to a lot of errors. When I first…
Misc584
  • 357
  • 3
  • 16
0
votes
1 answer

ValueError: Error when checking target: expected block5_pool to have 4 dimensions, but got array with shape (60000, 10)

I am trying to use vgg16 for classification of mnist digits using keras. The error generated is: --------------------------------------------------------------------------- ValueError Traceback (most recent call…
0
votes
1 answer

Error while using TimeDistributed with VGG19 Keras model

While using pre-trained VGG19 with with TimeDistributed in Keras, I have the following Error : TypeError: can only concatenate tuple (not "list") to tuple This is in windows, Keras, python3.6 def build_vgg(self): img =…
Ahmed
  • 11
  • 4
0
votes
1 answer

How to convert VGG from darknet to tensorflow?

I am trying to convert an existing VGG model (trained on 1 class) from Darknet format (including a .cfg file and .weights file) to the TensorFlow format. The end goal is to use the files in TensorFlow format with the Intel OpenVINO Toolkit. As an…
cla1n
  • 39
  • 2
0
votes
0 answers

How to use vgg-19 to predict single image?

I have trained this vgg-19 model and now need to predict single image. I have tried something like this: Cannot predict the label for a single image with VGG19 in Keras I add it at the end of model, but it doesn´t work. base_model =…
td23
  • 1
  • 2
0
votes
1 answer

Keras VGGFace extracting features

I am trying to extract features from a convolution layer of the VGGFace model, using TensorFlow & Keras. This is my code: # Layer Features layer_name = 'conv1_2' # Edit this line vgg_model = VGGFace() # Pooling: None, avg or max out =…
Eutherpy
  • 4,471
  • 7
  • 40
  • 64
0
votes
2 answers

Keras VGG16 with flow_from_directory val_acc not rising

I use keras and import VGG16 network with imagenet weights to classify male/female photos. Strcture of directories is: split_1/train/male/*.jpg split_1/train/female/*.jpg split_1/val/female/*.jpg split_1/val/male/*.jpg I tried most of the…
pfoof
  • 195
  • 1
  • 13