Questions tagged [resnet]
740 questions
6
votes
0 answers
Use pre-trained ResNet 50 in Keras for images with 4 channels
Is there any way I can use the ImageNet weights for ResNet50 for my project which has images of shape (224,224,4)? The image has R,G,B,Y channels.
At the moment, I am simply using
model = ResNet50(include_top=True, weights=None,…

Rangan Das
- 323
- 2
- 11
6
votes
1 answer
System hangs after first epoch training in pytorch
So, I was trying to train on ResNet model in PyTorch using the ImageNet example in the GitHub repository.
Here's what my train method looks like (it is almost similar to that in example)
def train(train_loader, model, criterion, optimizer, epoch):
…

nirvair
- 4,001
- 10
- 51
- 85
6
votes
1 answer
Why is ReLU applied after residual connection in ResNet?
In the ResNet architecture, why is the ReLU activation applied after the element-wise addition with the residual in a residual block, instead of before it?

Shen Zhuoran
- 385
- 3
- 13
6
votes
2 answers
Does resnet have fully connected layers?
In my understanding, fully connected layer(fc in short) is used for predicting.
For example, VGG Net used 2 fc layers, which are both 4096 dimension. The last layer for softmax has dimension same with classes num:1000.
But for resnet, it used…

David Ding
- 680
- 3
- 9
- 19
6
votes
2 answers
keras val very slow when use model.fit_generator
When I use my dataset to turn base on Resnet-50 in Keras(backend is tensorflow),
I find it very odd that when after each epoch, val is slower than train.
I don't know why, is it because my GPU do not have enough memory? My GPU is K2200, which has…

Yanning Zhou
- 61
- 1
- 2
5
votes
1 answer
ResNet50v2 in Keras
I want to load pre-trained ResNet50v2 model in Keras. I tried
keras.applications.resnet_v2.ResNet50V2()
This gave an error
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'keras.applications' has no…

Nagabhushan S N
- 6,407
- 8
- 44
- 87
5
votes
3 answers
Resnet-18 as backbone in Faster R-CNN
I code with pytorch and I want to use resnet-18 as backbone of Faster R-RCNN. When I print structure of resnet18, this is the output:
>>import torch
>>import torchvision
>>import numpy as np
>>import torchvision.models as models
>>resnet18 =…

CVDE
- 393
- 3
- 19
5
votes
1 answer
how to freeze some layers when fine tune resnet50
I am trying to fine tune resnet 50 with keras. When I freeze all the layers in resnet50, everything works OK. However, I want to freeze some layers of resnet50, not all of them. But when I do this, I get some errors. Here is my code:
base_model =…

Abraham Ben
- 147
- 1
- 2
- 12
5
votes
2 answers
Not able to load weights for fine tuning in Keras with ResNet50
I first trained with ResNet-50 layers frozen on my dataset using the following :
model_r50 = ResNet50(weights='imagenet', include_top=False)
model_r50.summary()
input_layer = Input(shape=(img_width,img_height,3),name = 'image_input')
output_r50 =…

Hooli
- 711
- 2
- 13
- 24
4
votes
0 answers
Convert .ckpt to .h5
I have trained the model using resnet18 for mask R-CNN detection. For every epoch, it created a ".ckpt" file only.
Now I want to use that .ckpt file as the detector for detecting images. I have python code that takes a ".h5" file for…

Dhanraj Jain
- 61
- 4
4
votes
1 answer
tensorflow - Couldn't build proto file into descriptor pool
I installed anaconda, created a fresh new environment and installed tensorflow via pip.
Then I tried this:
import tensorflow as tf
tf.keras.applications.ResNet152V2(
include_top=True,
weights="imagenet",
input_tensor=None,
…

Tobi Lawful
- 105
- 1
- 7
4
votes
1 answer
SimCLR does not learn representations
So I'm trying to train a SimCLR network with a custom lightweight ConvNet backbone (tried it with a ResNet already) on a dataset containing first 5 letters of the alphabet out of which two are randomly selected and placed in random positions in the…

Tarun Narayanan
- 57
- 3
4
votes
2 answers
How to use model architecture of pretrained models but no weights
I want to use ResNet model architecture and want to change last few layers; how can I only use model architecture from model zoo in Tensorflow?

nerdalert
- 41
- 1
- 2
4
votes
1 answer
Implementing a simple ResNet block with PyTorch
I'm trying to implement following ResNet block, which ResNet consists of blocks with two convolutional layers and a skip connection. For some reason it doesn't add the output of skip connection, if applied, or input to the output of convolution…

L0KiZ
- 69
- 1
- 2
- 7
4
votes
1 answer
ValueError: Operands could not be broadcast together with shapes (54, 54, 128) (54, 54, 64)
I wrote a ResNet block with three convolutional layers:
def res_net_block(input_data, filters, kernel_size):
kernel_middle = kernel_size + 2
filters_last_layer = filters * 2
x = Conv2D(filters, kernel_size, activation = 'relu', padding =…

Yana
- 785
- 8
- 23