Comments (11)
probably corrupted dataset
from keras-transfer-learning-for-oxford102.
Did you manage to get this working? I have the following error in bootstrap.py:
move_files('train', labels[idx_test, :])
Index Error: too many indices
Any ideas? Do you have a fully working version you could send please?
from keras-transfer-learning-for-oxford102.
check vgg16.py
ImageDataGenerator.flow_from_directory() has a default batch_size, predict_generator() take parameter steps, in the script steps=config.nb_train_samples, which means you are getting nb_train_samples*batch_size samples from the generator, you can set batch_size=1 or steps=config.nb_train_samples/batch_size
I guess in older versions of keras the input parameter acctually takes the whole number of samples to be generated. I'm using keras2.0.4
from keras-transfer-learning-for-oxford102.
I'm using keras 2.0.4. We have this function in save_bottleneck_features() in vgg16.py:
generator = datagen.flow_from_directory(
config.train_dir,
target_size=config.img_size,
shuffle=False,
classes=config.classes)
bottleneck_features_train = model.predict_generator(generator, config.nb_train_samples)
What do I need to change? Do I do the same for validation?
from keras-transfer-learning-for-oxford102.
@djones4487169
Add batch_size=1 to the parameters, do the same for validation. Also you may need to modify tune(). You can check keras.io for how those functions works.
Making these modifications will get you through save_bottleneck_features() & train_top_model(), there are some other problems when running tune(), I haven't looked into them. You may want to consider using a lower version of keras to run the scripts directly.
from keras-transfer-learning-for-oxford102.
I got it working up to model fitting and 1st epoch but then:
ResourceExhaustedError: OOM when allocating tensor with shape [4096,4096]
Any ideas how to solve this or free up memory to allow it fit the model?
from keras-transfer-learning-for-oxford102.
Got it training by changing 4096 in both dense layers to 1024 and then 256.
from keras-transfer-learning-for-oxford102.
Error in tune():
Negative dimension size caused by subtracting 2 from 1 for 'block2_pool_1/MaxPool' with input shapes: [?,1,112,128]
I'm using tensorflow backend?
from keras-transfer-learning-for-oxford102.
Changed:
basee_model = VGG16(weights='imagenet', include_top=False, input_tensor=Input(shape=(3,) + config.img_size))
To:
base_model = VGG16(weights='imagenet', include_top=False, input_tensor=Input(shape=(224, 224, 3)))
from keras-transfer-learning-for-oxford102.
Any ideas about this error in function get_top_model_for_VGG16() in vgg16.py :
you called 'set_weights' on layer 'fc1' with a weight list of length 1, but it was expecting 2 weights
from keras-transfer-learning-for-oxford102.
@djones4487169, the code does not support TensorFlow, please use Theano.
@cottontail7, I didn't test the code with Keras 2, I would suggest using Keras 1.2 with it as Keras 2 has some issues with weights of pre-trained models
from keras-transfer-learning-for-oxford102.
Related Issues (20)
- Issue with running predict.py file HOT 4
- IndexError: too many indices error when running bootstrap.py HOT 8
- Same problem with fine tuning. HOT 1
- predict.py fails on vgg16 HOT 1
- Dataset directory's structure HOT 4
- dict().values returns dict_values in python 3.6 HOT 1
- server.py ValueError
- ValueError: Dimension 1 in both shapes must be equal, but are 0 and 100 for 'Assign_320' (op: 'Assign') with input shapes: [2048,0], [2048,100].
- Is some change needed in resnet50.py? Error while creating model HOT 1
- Error in weights file I guess...I am at a loss HOT 13
- Request for enhancement
- Pretrained model HOT 2
- System calls classification
- What does the '[103.939, 116.779, 123.68]' means?
- How can I avoid "early stopping"?
- cannot download vgg16_tf_dim_ordering_notop.h5 file. HOT 9
- Value error: input samples have different number of arrays with target samples. HOT 8
- me again. Keyerror. "Unable to open object (Object 'fc1' doesn't exist)" HOT 4
- finetuning multiclass model HOT 2
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 keras-transfer-learning-for-oxford102.