Questions tagged [pre-trained-model]

A machine learning model created by someone else. Questions about the practical use and implementation details (using a pretrained model as a starting point, or benchmark) are allowed; however, questions about the theory behind these models are off-topic.

A machine learning model created by someone else. Questions about the practical use and implementation details (using a pretrained model as a starting point, or benchmark) are allowed, questions about the theory behind these models are off-topic and should be asked on the Artificial Intelligence site.

505 questions
4
votes
1 answer

Keras pretrained Xception model always gives the prediction 'sewing_machine'

I'm using Keras pretrained model 'Xception' to do image recognition. However, no matter what picture I give Xception, the predictions are always: Predicted: [[('n04179913', 'sewing_machine', 1.0), ('n15075141, toilet_tissue', 0.0), ('n02317335',…
4
votes
3 answers

Tensorflow load pre-trained model use different optimizer

I want to load a pre-trained model (optimized by AdadeltaOptimizer) and continue training with SGD (GradientDescentOptimizer). The models are saved and loaded with tensorlayer API: save model: import tensorlayer as…
Irene W.
  • 679
  • 1
  • 6
  • 15
4
votes
1 answer

Keras VGGnet Pretrained Model Variable Sized Input

I want to extract features of a 368x368 sized image with VGG pretrained model. According to documentation VGGnet accepts 224x224 sized images. Is there a way to give variable sized input to Keras VGG? Here is my code: # VGG Feature…
mkocabas
  • 703
  • 6
  • 19
4
votes
1 answer

Pre-trained checkpoints (.chkpt) Vs GraphDef (.pb)

I am trying to extract features of a new data-set by using a pre-trained network like that one classify_image_graph_def.pb released by Google in the tensorflow (inception-2015-12-05.tgz). I was successful on that as there is tutorial at…
3
votes
3 answers

How to fix "Trainer: evaluation requires an eval_dataset" in Huggingface Transformers?

I’m trying to do a finetuning without an evaluation dataset. For that, I’m using the following code: training_args = TrainingArguments( output_dir=resume_from_checkpoint, evaluation_strategy="epoch", per_device_train_batch_size=1, ) def…
3
votes
0 answers

How to execute a trained model with python?

I downloaded a template and the same is in this path: \home\wisehipoppotamus\LLAMA Inside the LLAMA folder there are 4 folders referring to each model, which are the folders: 7B 13B 30B 65B Plus 2…
3
votes
3 answers

KeyError: 'The optimizer cannot recognize variable dense_1/kernel:0. for pretrained keras model VGG19

I'm using the following code to load an imagenet pre-trained VGG19 model and fit to my custom dataset. from keras.applications.vgg19 import VGG19 optim = tf.keras.optimizers.RMSprop(momentum=0.9) vgg19 = VGG19(include_top=False,…
3
votes
1 answer

Should I adjust the weights of embedding of newly added tokens?

I'm a beginner of neural language processing. Recenttly, I try to train a text generation model based on GPT-2 with huggingface transformers. I added some new tokens to the tokenizer and resize the embedding of the model with…
3
votes
0 answers

How to post-train BERT model on custom dataset

I want to get the BERT word embeddings which will be used in another down-stream task later. I have a corpus for my custom dataset and want to further pre-train the pre-trained Huggingface BERT base model. I think this is called post-training. How…
3
votes
1 answer

What is the difference between TFHub and Model Garden?

TensorFlow Hub is a repository for pre-trained models. Model Garden (Model Zoo) also keeps SOTA models and provides facilities for downloading and leveraging its models like TfHub, and both of them are created by TensorFlow. Why did Tensorflow make…
Kaveh
  • 4,618
  • 2
  • 20
  • 33
3
votes
1 answer

how can I load pretrained model by pytorch? ( mmfashion)

import io import torch import torch.nn as nn from torchvision import models from PIL import Image import torchvision.transforms as transforms checkpoint_path = 'C:/venvs/ai/aiproduct/latest.pth' pretrained_weights = torch.load(checkpoint_path,…
elon jeong
  • 69
  • 1
  • 5
3
votes
1 answer

Keras model gets worse when fine-tuning

I'm trying to follow the fine-tuning steps described in https://www.tensorflow.org/tutorials/images/transfer_learning#create_the_base_model_from_the_pre-trained_convnets to get a trained model for binary segmentation. I create an encoder-decoder…
3
votes
0 answers

initialize dense tensorflow layer with pretrained weights

I'm trying to initialize the weights and biases of tensorflow.keras.layers.Dense with pretrained weights and biases. I've tried 2 methods, first dims = [960,480,200,75,25] dense_params['weights'] = (weights['w1'], biases['b1']) #…
gary69
  • 3,620
  • 6
  • 36
  • 50
3
votes
1 answer

Loading pre trained Attention model in keras custom_objects

I am loading a pretrained attention model in Keras using load_model() . My Attention class is defined as below. # attention class from keras.engine.topology import Layer from keras import initializers, regularizers, constraints from keras import…
der_radler
  • 549
  • 1
  • 6
  • 17
3
votes
1 answer

Config change for a pre-trained transformer model

I am trying to implement a classification head for the reformer transformer. The classification head works fine, but when I try to change one of the config parameters- config.axial_pos_shape i.e sequence length parameter for the model it throws an…