Questions tagged [resnet]
740 questions
9
votes
2 answers
Why use fixed padding when building resnet model in tensorflow
Tensorflow has an official realization of resnet in github. And it uses fixed padding instead of normal tf.layers.conv2d.
Something like this:
def conv2d_fixed_padding(inputs, filters, kernel_size, strides, data_format):
"""Strided 2-D…

Keshawn Hsieh
- 185
- 1
- 8
9
votes
1 answer
Keras model.predict always 0
I am using keras applications for transfer learning with resnet 50 and inception v3 but when predicting always get [[ 0.]]
The below code is for a binary classification problem. I have also tried vgg19 and vgg16 but they work fine, its just resnet…

Stig
- 353
- 1
- 3
- 12
8
votes
1 answer
ModuleNotFoundError: No module named 'keras.applications.resnet50 on google colab
I am trying to run an image-based project on colab. I found the project on github. Everything runs fine till I reached the cell with the following code:
import keras
from keras.preprocessing.image import ImageDataGenerator
from…

Anonymous
- 83
- 1
- 1
- 4
8
votes
4 answers
How to calculate the f1-score?
I have a pyTorch-code to train a model that should be able to detect placeholder-images among product-images. I didn't write the code by myself as I am very unexperienced with CNNs and Machine Learning.
My boss told me to calculate the f1-score for…

lxg95
- 553
- 2
- 8
- 28
8
votes
2 answers
How to adapt ResNet to time series data
I am trying to use the convolutional residual network neural network architecture (ResNet). So far, I have implemented simple convolutions (conv1D) for time series data classification using Keras.
Now, I am trying to build ResNet using Keras but I'm…

Pavithran Ravichandiran
- 1,711
- 1
- 17
- 20
7
votes
2 answers
Tensorflow 2 Object Detection with OpenCV C++
I have trained SSD ResNet V1 model using Tensorflow 2 Object Detection API. Then I wanted to use this model with OpenCV in C++ code.
First of all, after training I had three files:
checkpoint
ckpt-101.data-00000-of-00001
ckpt-101.index
Note that I…

Андрей Диденко
- 146
- 1
- 7
7
votes
2 answers
Stuck understanding ResNet's Identity block and Convolutional blocks
I'm learning Residual Networks (ResNet50) from Andrew Ng coursera lectures. I understand that one of the main reasons why ResNets work is that they can learn identity function and that's why adding more and more layers in network does not hurt the…

Kaushal28
- 5,377
- 5
- 41
- 72
7
votes
2 answers
Residual Neural Network: Concatenation or Element Addition?
With the residual block in residual neural networks, is the addition at the end of the block true element addition or is it concatenation?
For example, would addition([1, 2], [3, 4]) produce [1, 2, 3, 4] or [4, 6] ?

C. R.
- 77
- 1
- 2
7
votes
2 answers
Keras pretrain CNN with TimeDistributed
Here is my problem, I want to use one of the pretrain CNN network in a TimeDistributed layer. But I have some problem to implement it.
Here is my model:
def bnn_model(max_len):
# sequence length and resnet input size
x = Input(shape=(maxlen,…

rAyyy
- 1,239
- 12
- 16
6
votes
1 answer
RuntimeError: Unsupported qscheme: per_channel_affine
I'm following a tutorial on quantization aware training here for a modified Resnet18 model which is here:
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# Modified from
#…

Manu Dwivedi
- 77
- 7
6
votes
1 answer
ValueError: Unable to create dataset (name already exists) while saving tensorflow model
I am trying to save the trained model below.
resnet = ResNet50V2(input_shape=(im_size,im_size,3), weights='imagenet', include_top=False)
headModel = AvgPool2D(pool_size=(3,3))(resnet.output)
headModel = Flatten(name="flatten")(headModel)
headModel =…

Jeanne Chaverot
- 147
- 3
- 11
6
votes
2 answers
ImageNet pretrained ResNet50 backbones are different between Pytorch and TensorFlow
"Obviously!", you might say... But there's one significant difference that I have trouble explaining by the difference in random initialization.
Take the two pre-trained basenets (before the average pooling layer) and feed them with the same image,…

Jav
- 1,445
- 1
- 18
- 47
6
votes
1 answer
With ResNet50 the validation accuracy and loss is not changing
I am trying to do image recognition with ResNet50 in Python (keras). I tried to do the same task with VGG16, and I got some results like these (which seem okay to me):
resultsVGG16 . The training and validation accuracy/loss functions are getting…

Peter Nagy
- 63
- 1
- 6
6
votes
4 answers
Classifying images with very similar features belonging to different classes
I have a dataset in which i need to classify certain set of labelled images. Currently this is done by human experts so the dataset available is of good quality. The images have some very similar features.
To state an example, we could assume that…

Niranjan A
- 95
- 2
- 8
6
votes
1 answer
Modify ResNet50 output layer for regression
I am trying to create a ResNet50 model for a regression problem, with an output value ranging from -1 to 1.
I omitted the classes argument, and in my preprocessing step I resize my images to 224,224,3.
I try to create the model with
def…

DaveS
- 105
- 1
- 1
- 8