Comments (13)
I ran the train.py with these theano flags
optimizer=fast_compile
exception_verbosity=high
to get some more information:
Model is created
Fine tuning...
Freezing 80 layers
Found 6149 images belonging to 102 classes.
Found 1020 images belonging to 102 classes.
./models\base_model.py:43: UserWarning: Update your `fit_generator` call to the Keras 2 API: `fit_generator(<keras.pre..., epochs=1000, class_weight={0: 2.4765..., validation_data=<keras.pre..., validation_steps=1020, callbacks=[<keras.ca..., steps_per_epoch=192)`
class_weight=self.class_weight)
Epoch 1/1000
*GpuDnnConv images and kernel must have the same stack size*
Apply node that caused the error: GpuDnnConv{algo='small', inplace=False}(GpuContiguous.0, GpuContiguous.0, GpuAllocEmpty.0, GpuDnnConvDesc{border_mode='valid', subsample=(2, 2), conv_mode='conv', precision='float32'}.0, Constant{1.0}, Constant{0.0})
Toposort index: 2266
Inputs types: [CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D), <theano.gof.type.CDataType object at 0x000001E9F08BC3C8>, Scalar(float32), Scalar(float32)]
Inputs shapes: [(32, 3, 230, 230), (7, 7, 3, 64), (32, 7, 114, 84), 'No shapes', (), ()]
Inputs strides: [(158700, 52900, 230, 1), (1344, 192, 64, 1), (67032, 9576, 84, 1), 'No strides', (), ()]
Inputs values: ['not shown', 'not shown', 'not shown', <capsule object NULL at 0x000001EA0BD67540>, 1.0, 0.0]
Inputs type_num: ['', '', '', '', 11, 11]
Inputs name: ('image', 'kernel', 'output', 'descriptor', 'alpha', 'beta')
from keras-transfer-learning-for-oxford102.
@shirishr what Python and TensorFlow version do you use?
from keras-transfer-learning-for-oxford102.
from keras-transfer-learning-for-oxford102.
Sasha,
On the same machine I have a virtual machine with Ubuntu on it. In this I have installed Python 2.7 and Theano (No GPU) where everything seems to work but training is so slow ...it like watching grass grow slowly.
Do you have a trained model with Python 3.5? Should we ask @fcollet?
from keras-transfer-learning-for-oxford102.
@shirishr and what's the Kerase's version?
BTW don't think we should mention fcollet here, also weights issue is backend specific
from keras-transfer-learning-for-oxford102.
I see. My Keras version is 2.0.2
from keras-transfer-learning-for-oxford102.
Hello Sasha,
I upgraded my keras version 2.0.6 by using
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
That eliminated the error. So it is safe to close the issue
from keras-transfer-learning-for-oxford102.
I suggest a minor code change at lines 65~66 as:
the current lines are:
def get_input_tensor(self):
return Input(shape=(3,) + self.img_size)
which should be changed to:
def get_input_tensor(self):
if keras.backend.backend()=='tensorflow':
return Input(self.img_size + (3,))
else:
return Input(shape=(3,) + self.img_size)
I am assuming theano and CNTK use identical image_data_format
from keras-transfer-learning-for-oxford102.
@shirishr thanks for your patient. I'm just in process of adopting the code for
(Keras 1 or Keras 2) + (Theano or Tensorflow) + (Python 2 or Python 3)
from keras-transfer-learning-for-oxford102.
from keras-transfer-learning-for-oxford102.
@shirishr I'm glad you like it.
Speaking about Theano, try to set device using env variable THEANO_FLAGS='device=gpu0' or THEANO_FLAGS='device=cuda', also see the warnings on running the train process
from keras-transfer-learning-for-oxford102.
I have tried setting backend to "theano" in keras.json
and set device = "gpu" in .theanorc
and seen some compiler errors (gcc++ not found or minGW or cl.exe not found) I don't exactly remember. I have abandoned theano for the time being. I am afraid I may break something else if I change current setup. Maybe one of these days I will set a target to myself and fix that issue as well.
Thanks
from keras-transfer-learning-for-oxford102.
if TensorFlow works for you just use it as it's even faster and more perspective
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
- train error:ValueError: Input arrays should have the same number of samples as target arrays HOT 11
- 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
- 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.