GithubHelp home page GithubHelp logo

Comments (13)

shirishr avatar shirishr commented on August 11, 2024

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.

Arsey avatar Arsey commented on August 11, 2024

@shirishr what Python and TensorFlow version do you use?

from keras-transfer-learning-for-oxford102.

shirishr avatar shirishr commented on August 11, 2024

from keras-transfer-learning-for-oxford102.

shirishr avatar shirishr commented on August 11, 2024

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.

Arsey avatar Arsey commented on August 11, 2024

@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.

shirishr avatar shirishr commented on August 11, 2024

I see. My Keras version is 2.0.2

from keras-transfer-learning-for-oxford102.

shirishr avatar shirishr commented on August 11, 2024

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.

shirishr avatar shirishr commented on August 11, 2024

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.

Arsey avatar Arsey commented on August 11, 2024

@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.

shirishr avatar shirishr commented on August 11, 2024

from keras-transfer-learning-for-oxford102.

Arsey avatar Arsey commented on August 11, 2024

@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.

shirishr avatar shirishr commented on August 11, 2024

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.

Arsey avatar Arsey commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.