Questions tagged [resnet]

740 questions
59
votes
10 answers

Tensorflow Allocation Memory: Allocation of 38535168 exceeds 10% of system memory

Using ResNet50 pre-trained Weights I am trying to build a classifier. The code base is fully implemented in Keras high-level Tensorflow API. The complete code is posted in the below GitHub Link. Source Code: Classification Using RestNet50…
Madhi
  • 1,206
  • 3
  • 16
  • 27
42
votes
4 answers

How to remove the last FC layer from a ResNet model in PyTorch?

I am using a ResNet152 model from PyTorch. I'd like to strip off the last FC layer from the model. Here's my code: from torchvision import datasets, transforms, models model = models.resnet152(pretrained=True) print(model) When I print the model,…
Lee Jenkins
  • 2,299
  • 3
  • 24
  • 39
33
votes
3 answers

Implementing skip connections in keras

I am implementing ApesNet in keras. It has an ApesBlock that has skip connections. How do I add this to a sequential model in keras? The ApesBlock has two parallel layers that merge at the end by element-wise addition.
Siddhartha rao
  • 487
  • 1
  • 4
  • 9
17
votes
1 answer

Training Resnet deep neural network from scratch

I need to gain some knowledge about deep neural networks. For a 'ResNet' very deep neural network, we can use transfer learning to train a model. But Resnet has been trained over the ImageNet dataset. So their pre-trained weights can be used to…
user2445123
17
votes
2 answers

Scale layer in Caffe

I am looking through the Caffe prototxt for deep residual networks and have noticed the appearance of a "Scale" layer. layer { bottom: "res2b_branch2b" top: "res2b_branch2b" name: "scale2b_branch2b" type: "Scale" scale_param { …
Igor Ševo
  • 5,459
  • 3
  • 35
  • 80
16
votes
8 answers

I am not able to import resnet from keras.applications module

I'm unable to import this module import keras.applications.resnet ModuleNotFoundError in () ----> 1 import keras.applications.resnet ModuleNotFoundError: No module named 'keras.applications.resnet' keras resnet link
Aayush Bajaj
  • 161
  • 1
  • 1
  • 4
16
votes
1 answer

RuntimeError: Error(s) in loading state_dict for ResNet:

I am loading my model using the following code. def load_model(checkpoint_path): ''' Function that loads a checkpoint and rebuilds the model ''' checkpoint = torch.load(checkpoint_path, map_location = 'cpu') if checkpoint['architecture']…
Kavin Raju S
  • 1,214
  • 2
  • 17
  • 25
14
votes
6 answers

Massive overfit during resnet50 transfer learning

This is my first attempt at doing something with CNNs, so I am probably doing something very stupid - but can't figure out where I am wrong... The model seems to be learning fine, but the validation accuracy is not improving (ever - even after the…
morienor
  • 339
  • 1
  • 2
  • 8
13
votes
2 answers

Resnet network doesn't work as expected

Hi I was trying to train a cancer dataset, using the Resnet neural network by using the fine-tuning approach Here is how I used to fine-tune it. image_input = Input(shape=(224, 224, 3)) model = ResNet50(input_tensor=image_input,…
user3789200
  • 1,166
  • 2
  • 25
  • 45
12
votes
2 answers

TensorFlow ValueError: The channel dimension of the inputs should be defined. Found `None`

I am trying to implement a "Dilated Residual Network" as described in this Paper in TensorFlow (s. PyTorch Implementation here) to train it on the CityScapes Dataset and use it for Semantic Image Segmentation. Unfortunately I get an error when…
crossx
  • 137
  • 1
  • 1
  • 5
11
votes
2 answers

How to count the amount of layers in a CNN?

The Pytorch implementation of ResNet-18. has the following structure, which appears to be 54 layers, not 18. So why is it called "18"? How many layers does it actually have? ResNet ( (conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2),…
10
votes
3 answers

How do I re-use trained fastai models?

How do I load pretrained model using fastai implementation over PyTorch? Like in SkLearn I can use pickle to dump a model in file then load and use later. I've use .load() method after declaring learn instance like bellow to load previously saved…
ni8mr
  • 1,725
  • 3
  • 31
  • 58
10
votes
4 answers

Looking for resnet implementation in tensorflow

Are there any resnet implementations in tensorflow? I came across a few (e.g. https://github.com/ry/tensorflow-resnet, https://github.com/xuyuwei/resnet-tf) but these implementations have some bugs (e.g. see the Issues section on the respective…
mac_i
  • 209
  • 1
  • 3
  • 5
9
votes
2 answers

Fastai learner not loading

So I'm trying to load a model using: learn = create_cnn(data, models.resnet50, lin_ftrs=[2048], metrics=accuracy) learn.clip_grad(); learn.load(f'{name}-stage-2.1') But I get the following error RuntimeError: Error(s) in loading state_dict for…
M090009
  • 1,129
  • 11
  • 20
9
votes
1 answer

Using ROIPooling layer with a pretrained ResNet34 model in MxNet-Gluon

Assume I have a Resnet34 pretained model in MXNet and I want to add to it the premade ROIPooling Layer included in the API: https://mxnet.incubator.apache.org/api/python/ndarray/ndarray.html#mxnet.ndarray.ROIPooling If the code for initializing…
obelix
  • 880
  • 2
  • 16
  • 43
1
2 3
49 50