Questions tagged [transfer-learning]

749 questions
0
votes
1 answer

Keras predict_generator outputs a different number of samples

I'm trying to improve the performance of a transfer learning model that uses Xception as the pre-trained model by using data augmentation. The goal is to classify dog breeds. train_tensors and valid_tensors contain the training and testing images…
Pawan Bhandarkar
  • 304
  • 2
  • 10
0
votes
1 answer

Keras Prediction gives the same result for different classes in test set

all. I am using transfer learning to build a new model based on my own samples. The learning framework is Keras 2.0+. I modified the codes in reference to this page: Fine-tune InceptionV3 on a new set of…
0
votes
1 answer

Facing trouble in converting tensorflow model to tflite model throught command line on windows

Facing trouble in converting tensorflow model to tflite model throught command line on windows. IMAGE_SIZE=224 tflite_convert \ --graph_def_file=tf_files/retrained_graph.pb \ --output_file=tf_files/optimized_graph.lite \ …
Taha alam
  • 372
  • 3
  • 11
0
votes
1 answer

Connect pre-trained model with keras, without top, to custom top model

i do transfer-learning using keras. this is what i done: load pre-trained model (Mobilnet) without top. build model of some layers, input is output of mobilnet, and output is softmax (classification mission) now i train the top model on the…
0
votes
1 answer

I want all the output of the pretrained VGG16 model as well as the new classes it is trained on

I have tried transfer learning using VGG16 but only getting a result for those classes which are trained.I want that the output consists of both the VGG16 classes+ my new trained classes. Is it possible? I have attached my whole code. import…
0
votes
1 answer

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

I am trying to use a pretained CNN (VGG16) but I keep getting the following error: ValueError: Error when checking input: expected input_2 to have shape (224, 224, 3) but got array with shape (244, 244, 3) Here is my full code: import numpy as np…
Wanderer
  • 1,065
  • 5
  • 18
  • 40
0
votes
1 answer

Image Annotation for Large Dataset

I have this huge data set for which I have only taken a sample from that data to show you,now as you can see it has two class cat and dog where in the training data i have to label it manually since the cat and dog images are mixed, so is there any…
0
votes
1 answer

How to get VGG model prediction for a given input image?

Here the image has to be transformed according to the input type for a VGG16 model.I have used the following code for this,I am using a VGG16 model form the library and setting the pre trained value to be true import numpy as np from glob import…
0
votes
1 answer

ValueError, Error when checking target: expected dense_1 to have 4 dimensions

I'm trying to fine-tune a MobileNet but I'm receiving the following error: ValueError, Error when checking target: expected dense_1 to have 4 dimensions, but got array with shape (10, 14) Is there any conflict with how I set my directory…
0
votes
1 answer

Transfer learning(VGG, ResNet) with different image sizes

I wish to use transfer learning to process images, and my images have different sizes. I think in general convolutional layers can take variable input size, but fully connected layers can only take input of specific size. However, the Keras…
0
votes
1 answer

Tensorflow session - ValueError: GraphDef cannot be larger than 2GB

I am trying to iterate over dataset batches and run inference on a pre-trained model. I created a session and loaded the model as such: import numpy as np sess = tf.Session() saver =…
Shibani
  • 148
  • 1
  • 3
  • 14
0
votes
0 answers

ResNet50 transfer learning fails

I need one or more hints to get over the first pain in transfer-learning. The following code is a stripped-down version of what I am actually trying to do, but it shows the issues even with one the fake image (A: empty / B: empty + little square) I…
Any Goe
  • 1
  • 1
0
votes
1 answer

Data Augmentation hurts accuracy Keras

I'm trying to adapt Deep Learning with Python section 5.3 Feature extraction with Data Augmentation to a 3-class problem with resnet50 (imagenet weights). Full code at https://github.com/morenoh149/plantdisease from keras import models from keras…
Harry Moreno
  • 10,231
  • 7
  • 64
  • 116
0
votes
1 answer

How can i train model on additional classes without retraining on previous class in tensorflow?

How I can train my face recognition system on new personalities (classes) without retraining the model on old personalities (old classes)? I load google's pretrained model Resnet v1 in order to train system to recognize faces of personalities and in…
0
votes
1 answer

Keras model params are all "NaN"s after reloading

I use transfer learning with Resnet50. I create a new model out of the pretrained model provided by Keras (the 'imagenet'). After training my new model, I save it as following: # Save the Siamese Network architecture siamese_model_json =…
edn
  • 1,981
  • 3
  • 26
  • 56