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
1
vote
1 answer

Transfer Learning with VGG16 Model Fit Error

I am new to transfer learning and cannot understand what is causing the following error: ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type int) when running model.fit. What could be leading to this problem? #created…
1
vote
1 answer

When using pretrained model(vgg, resnet like) as backbone, should we use it in `eval mode` or in `train mode`?

When we use a pretrained model, e.g. vgg16, as a backbone of the whole model which plays as a feature extractor, the model's data flow can be depicted as below: Data --> vgg16 --> another network --> output As for now, I've set False require_grads…
Karl
  • 23
  • 4
1
vote
1 answer

Modify training function of 3 nets with shared classifier

I have 3 VGG: VGGA, VGGB and VGG*, trained with the following training function: def train(nets, loaders, optimizer, criterion, epochs=20, dev=None, save_param=False, model_name="valerio"): # try: nets = [n.to(dev) for n in nets] …
CasellaJr
  • 378
  • 2
  • 11
  • 26
1
vote
1 answer

models.vgg16(pretrained=True) due to TqdmKeyError: "Unknown argument(s): {'unit_divisor': 1024}"

im trying to run : models.vgg16(pretrained=True) and get pretained model for pytorch but i get as an error this, this error already was asked about before- but answer from there aren't helping me :/ I tried to upgrade tqdm, and twine but with no…
1
vote
0 answers

Video Quality Assessement

i'm trying to design a pretraind cnn + lstm network in order to video quality assessment. i have done this steps: extracting frames and their quality score. resizing them to 224*224 i want to use this code, it's related to video classification and…
mohamad
  • 23
  • 1
  • 1
  • 4
1
vote
1 answer

Run time connection loss while trainig VGG 16 model on Google Collaboratory

I'm Training the VGG16 model in colab while running it some time disconnects and reconnect again and sometimes while reaching 20, 21/35 epochs all connection loss and when I reconnect drive mounting restart due to this I lost all outputs, so I have…
1
vote
0 answers

Problems with VGG model to tflite outputs

I have been having problems with my tflite outputs after converting it from my .h5 and I am pretty sure its to do with how my model is set up, could someone have a look and point me out where I am going…
Omar Inuwa
  • 47
  • 5
1
vote
1 answer

Unable to use SHAP GradientExplainer due to Tensorflow error (tensors are unhashable)

I have been stuck on this error for a long time and is there anyway to resolve it without downgrading my tensorflow version? All the solutions I have found till now have recommended using TF<2.0 which I don't want to do. Current TF version = 2.4.1,…
AnaDesh
  • 23
  • 11
1
vote
1 answer

Is it normal to get ETA: 6:43:26 hours to complete the first epoch

I have crated the below vgg16 based CNN and I want to train it for 50 epochs. but it shows nearly 7 hours (ETA: 6:43:26) to complete the first epoch. could anyone please tell me is this normal with 209222 training images and 40000 validation…
user10960174
1
vote
1 answer

MethodError while running VGG19 model in Flux (Julia)

The below mentioned code is taken from model-zoo. I am trying to run the vgg19 tutorial in julia using flux library. Code: #model using Flux vgg19() = Chain( Conv((3, 3), 3 => 64, relu, pad=(1, 1), stride=(1, 1)), Conv((3, 3), 64…
Mohammad Saad
  • 1,935
  • 10
  • 28
1
vote
1 answer

How to use VGG19 transfer learning pretraining

I'm working on a VQA model, and I need some help as I'm new to this. I want to use transfer learning from the VGG19 network before running the train, so when I start the train, I will have the image features ahead (trying to solve performance…
1
vote
1 answer

Error after merging two Deep Learning models VGG16 and ResNet50

I have merged two different models namely VGG16 and ResNet50 and given the outputs of the two models as input to another model. I have checked the Layers graph is correct. Before merging the code was running perfectly fine giving correct outputs. I…
1
vote
1 answer

How to resize all images in the dataset before passing to a neural network?

I am using colab to build CNN. Input shape to network(vgg16) is (224,224,3), while i have a training dataset(CIFAR10) having 50000 samples of (32,32,3). I tried tf.resize() for a single image it works and perfectly resizes. im =…
1
vote
1 answer

Preprocessing test images using opencv for prediction

I am working on a dataset of gray images that are saved under RGB format. I trained VGG16 on this dataset, and preprocessed them this way: train_data_gen = ImageDataGenerator(rescale=1./255,rotation_range = 20, …
Safa
  • 485
  • 2
  • 5
  • 24
1
vote
1 answer

VGG19 from tf.keras does not support indexing

I'm loading a standalone VGG19 in a Ubuntu virtual machine with Tensorflow1.14.0 like this : VGG19 = scipy.io.loadmat(path_VGG19) #stored in my disc VGG19_layers = VGG19['layers'][0] and then I pass it to the function _conv2dWithRelu(): def…
James
  • 9
  • 5