Comments (5)
I solved the problem after reading through source code for Resnet50.py
. If anyone encounter the same problem, please add the input_shape
parameter when you call Resnet50()
:
model = ResNet50(include_top=False, weights='imagenet', input_tensor=Input(shape=(224,224,3)))
If you are using Keras ImageDataGenerator
, the input shape will be automatically inferred.
from deep-learning-models.
Regarding the error:
input size must be at least 197x197,
Had the same issue, but disappeared after upgrading keras to 2.2.4 (with backend tensorflow 1.12.0 in case it matters).
from deep-learning-models.
@MrXu
hi, i also use the resnet50, and i want set input_size=(48,48,3)
but it show me an error.
valueerror input size must be at least 197x197,
i check the doc, it show me ,
width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.,
It's so weird.
from deep-learning-models.
You should use the functional API. So for example try:
if K.image_dim_ordering() == 'tf':
inp = Input(shape=(224, 224, 3), name='input_image')
else:
inp = Input(shape=(3, 224, 224), name='input_image')
main_model = Resnet50(include_top=False)(inp)
main_out = Dropout(0.5)(main_model)
main_out = Dense(512, activation='relu', name='fcc_0')(main_out)
main_out = Dropout(0.5)(main_model)
main_out = Dense(output_classes, activation='softmax', name='class_id')(main_out)
model = Model(input=inp, output=artist_out)
from deep-learning-models.
@AntreasAntoniou Thanks, but I need to load weights for the Sequential model. Also, when I try to use main_model = Resnet50(include_top=False)(inp)
, it complains Exception: You are attempting to share a same
BatchNormalization layer across different data flows.
from deep-learning-models.
Related Issues (20)
- ResNet50 unexpected keyword argument 'include_top' HOT 3
- Optimize AUC metric on compile function with R Keras API
- Resnet50 raises AttributeError: 'NoneType' object has no attribute 'image_data_format'
- An existing connection was forcibly closed by the remote host HOT 1
- Resnet50 has wrong shape after stem - problem was corrected in keras-applications version.
- Making a Keras layer dynamic for Tensorflow operations(Tensorflow object detection API) HOT 1
- Would it be possible to integrate object detection or image segmentation models?
- ImportError: cannot import name '_obtain_input_shape' from 'keras.applications.imagenet_utils' (C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\applications\imagenet_utils.py) HOT 1
- -- issue is added by mistake --
- Why keras is slower HOT 1
- Why keras is slower'
- how to change the models' path ?
- No normalization in prepocess_input function HOT 1
- keras applications
- Loading Keras Model for Multiprocess
- download speed too slow HOT 2
- NameError: name 'X_val_prep' is not defined
- ValueError: Error when checking input: expected vgg16_input to have shape (244, 244, 3) but got array with shape (224, 224, 3)
- The model expects 0 input arrays, but only received one array.
- SignatureDoesNotMatch when downloading the releases v0.7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-learning-models.