Questions tagged [transfer-learning]

749 questions
36
votes
8 answers

Label Smoothing in PyTorch

I'm building a ResNet-18 classification model for the Stanford Cars dataset using transfer learning. I would like to implement label smoothing to penalize overconfident predictions and improve generalization. TensorFlow has a simple keyword argument…
Jared Nielsen
  • 3,669
  • 9
  • 25
  • 36
26
votes
4 answers

The added layer must be an instance of class Layer. Found:

I am new to machine learning. I was following this tutorial on fine-tuning VGG16 models. The model loaded fine with this code: vgg_model = tensorflow.keras.applications.vgg16.VGG16() but gets this ERROR: TypeError: The added layer must be an…
Rstynbl
  • 545
  • 2
  • 6
  • 10
14
votes
5 answers

Confusion matrix and test accuracy for PyTorch Transfer Learning tutorial

Following the Pytorch Transfer learning tutorial, I am interested in reporting only train and test accuracy as well as confusion matrix (say using sklearn confusionmatrix). How can I do that? The current tutorial only reports train/val accuracy and…
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
11
votes
2 answers

Strange behaviour of the loss function in keras model, with pretrained convolutional base

I'm trying to create a model in Keras to make numerical predictions from the pictures. My model has densenet121 convolutional base, with couple of additional layers on top. All layers except for the two last ones are set to layer.trainable = False.…
9
votes
4 answers

How to choose which pre-trained weights to use for my model?

I am a beginner, and I am very confused about how we can choose a pre-trained model that will improve my model. I am trying to create a cat breed classifier using pre-trained weights of a model, lets say VGG16 trained on digits dataset, will that…
9
votes
0 answers

Tensorflow: Integrate Keras Model in Estimator model_fn

I am working on the problem of using a pretrained keras.applications model in the model_fn of a estimator. In my research group, we are using Tensorflow estimator since they offer many advantages through parallel training and evaluation,…
Simon
  • 398
  • 2
  • 11
8
votes
2 answers

Fine-tuning and transfer learning by the example of YOLO

I have a general question regarding fine-tuning and transfer learning, which came up when I tried to figure out how to best get yolo to detect my custom object (being hands). I apologize for the long text possibily containing lots of false…
kaktus
  • 169
  • 1
  • 1
  • 11
8
votes
1 answer

Data Preprocessing for NLP Pre-training Models (e.g. ELMo, Bert)

I plan to train ELMo or Bert model from scratch based on data(notes typed by people) on hand. The data I have now is all typed by different people. There are problems with spelling, formatting, and inconsistencies in sentences. After read the ELMo…
Xin
  • 331
  • 1
  • 3
  • 8
7
votes
2 answers

Pretraining a language model on a small custom corpus

I was curious if it is possible to use transfer learning in text generation, and re-train/pre-train it on a specific kind of text. For example, having a pre-trained BERT model and a small corpus of medical (or any "type") text, make a language…
7
votes
2 answers

Get output from a non final keras model layer

I am using ubuntu with python 3 and keras over tensorflow, I am trying to create a model using transfer learning from a pre trained keras model as explained here: I am using the following code import numpy as np from keras.applications import…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
6
votes
1 answer

Loading checkpoints while training a Faster-RCNN model on a custom dataset

I'm trying to load checkpoints and populate model weights using The Faster-RCNN architecture (Faster R-CNN ResNet50 V1 640x640 to be precise, from here. I'm trying to load the weights for this network similar to how it's done in the example notebook…
6
votes
1 answer

How can I use GPT 3 for my text classification?

I am wondering if I can be able to use OpenAI GPT-3 for transfer learning in a text classification problem? If so, how can I get start on it using Tensorflow, Keras.
6
votes
3 answers

What is freezing/unfreezing a layer in neural networks?

I have been playing around with neural networks for quite a while now, and recently came across the terms "freezing" & "unfreezing" the layers before training a neural network while reading about transfer learning & am struggling with understanding…
6
votes
8 answers

How to solve "No Algorithm Worked" Keras Error?

I tried to develop an FCN-16 model in Keras. I initialized the weights with similar FCN-16 model weights. def FCN8 (nClasses, input_height=256, input_width=256): ## input_height and width must be devisible by 32 because maxpooling with filter…
6
votes
2 answers

I am trying to generate a dataset but getting value error "ValueError: 'a' cannot be empty unless no samples are taken "

I am using a dataset containing over 3000 images for transfer learning. This is part of code: import glob import numpy as np import os import shutil np.random.seed(42) files = glob.glob('train/*') cat_files = [fn for fn in files if 'cat' in…
Sishel
  • 99
  • 1
  • 2
  • 4
1
2 3
49 50