Questions tagged [transfer-learning]

749 questions
5
votes
1 answer

How to use a language model for prediction after fine-tuning?

I've trained/fine-tuned a Spanish RoBERTa model that has recently been pre-trained for a variety of NLP tasks except for text classification. Since the baseline model seems to be promising, I want to fine-tune it for a different task: text…
5
votes
1 answer

How to fine tune a pre-trained GAN?

I would like to fine tune a pre-trained GAN available online using my own images. For example, BigGAN, which was trained on ImageNet, can generate realistic images. However, I do not want to generate the classes of images in ImageNet. I want to…
5
votes
1 answer

How to save parameters just related to classifier layer of pretrained bert model due to the memory concerns?

I fine tuned the pretrained model here by freezing all layers except the classifier layers. And I saved weight file with using pytorch as .bin format. Now instead of loading the 400mb pre-trained model, is there a way to load the parameters of the…
5
votes
2 answers

Keras AttributeError: 'Functional' object has no attribute 'shape'

Trying to add Densenet121 functional block to the model. I need Keras model to be written in this format, not using model=Sequential() model.add() method What's wrong the function,…
Bhuvan S
  • 213
  • 1
  • 4
  • 10
5
votes
4 answers

ValueError: The input must have 3 channels; got `input_shape=(200, 200, 1)`

I am trying to use Transfer learning with VGG16. I am using Keras. But I got error on vgg = vgg16.VGG16(include_top=False, weights='imagenet', input_shape=(IMG_SIZE, IMG_SIZE, 1)) Any help what is wrong ? Note: IMG_SIZE = 200 The trace of error…
Hitesh Somani
  • 620
  • 4
  • 11
  • 16
5
votes
1 answer

How to Find Confusion Matrix and Plot it for Image Classifier in PyTorch

Basically this is the VGG-16 Model, I have performed Transfer Learning and Fine Tuned the model, I have trained this model 2 weeks ago and found both the test and train accuracy but now I need Class wise accuracy of the model too, I am trying to…
5
votes
2 answers

Can ML.NET Image Classification Transfer Learning be resumed from a saved model .zip file or checkpoint? How?

I am using the NuGet packages Microsoft.ML (1.4.0) and SciSharp.TensorFlow.Redist (1.15.0) Initial training and saving the model works fine var options = new Microsoft.ML.Vision.ImageClassificationTrainer.Options() { FeatureColumnName =…
5
votes
1 answer

tensorflow lite conversion failed. "undefined symbol : _ZTIN10tensorflow6DeviceE" occured

tflite_model = converter.convert() tflite_model_file = 'converted_model.tflite' with open(tflite_model_file, "wb") as f: f.write(tflite_model) When I finally converted model within dot convert method, I got some error. Error Message: ValueError:…
soredive
  • 795
  • 1
  • 9
  • 25
5
votes
1 answer

How to do Inference and Transfer Learning with TensorFlow Frozen GraphDef (single saved_model.pb) from Google AutoML Vision Classification

I am using an exported classification model from Google AutoML Vision, hence I only have a saved_model.pb and no variables, checkpoints etc. I want to load this model graph into a local TensorFlow installation, use it for inference and continue…
5
votes
2 answers

How to get all layers' activations for a specific input for Tensorflow Hub modules?

I am new to Tensorflow Hub. I want to use I3D module and finetune this network to another dataset and I need to get the last hidden layer as well as some other layers' outputs. I was wondering if there is a way to get the other layers' activations.…
Siavash
  • 503
  • 1
  • 5
  • 25
4
votes
1 answer

Accuracy value more than 1 with nn.BCEWithLogitsLoss() loss function pytorch in Binary Classifier

I am trying to use nn.BCEWithLogitsLoss() for model which initially used nn.CrossEntropyLoss(). However, after doing some changes to the training function to accommodate the nn.BCEWithLogitsLoss() loss function the model accuracy values are shown as…
4
votes
1 answer

Remove top layer from pre-trained model, transfer learning, tensorflow (load_model)

I have pre-trained a model (my own saved model) with two classes, which I want to use for transfer learning to train a model with six classes. I have loaded the pre-trained model into the new training script: base_model =…
maarnaa
  • 53
  • 6
4
votes
1 answer

GradCAM with Transfer-Learning and augmentation layers at imput

I'm trying to implement GradCAM to a transfer-learning model. For that reason I need an additional output from the last Convolutional Layer of the base model. My model consists of preprocessing/augmentation layers, pretrained MobileNet and a custom…
dergisler
  • 51
  • 1
4
votes
1 answer

How to prepare text for BERT - getting error

I am trying to learn BERT for text classification. I am finding some problem in preparing data for using BERT. From my Dataset, I am segregating the sentiments and reviews as: X = df['sentiments'] y = df['reviews'] #it contains four different class…
K C
  • 413
  • 4
  • 15
4
votes
0 answers

How to extract weights of DQN agent in TF-Agents framework?

I am using TF-Agents for a custom reinforcement learning problem, where I train a DQN (constructed using DqnAgents from the TF-Agents framework) on some features from my custom environment, and separately use a keras convolutional model to extract…
1
2
3
49 50