Skip to content

Memory used in models vgg #64

@ProgRoman

Description

@ProgRoman

For classification problems, I use the model vgg. I have a computer with Debian 6.0.9, 32 bit, RAM 15.8Gb. When I try to load a model vgg19 or vgg16. I receive a memory error

cnn_vgg19 = build_model_vgg19()
output_layer = cnn_vgg19['prob']

MemoryError Traceback (most recent call last)
in ()
----> 1 cnn_vgg19 = build_model_vgg19()
2 output_layer = cnn_vgg19['prob']

in build_model_vgg19()
39 net['conv5_3'], 512, 3, pad=1, flip_filters=False)
40 net['pool5'] = PoolLayer(net['conv5_4'], 2)
---> 41 net['fc6'] = DenseLayer(net['pool5'], num_units=4096)
42 net['fc6_dropout'] = DropoutLayer(net['fc6'], p=0.5)
43 net['fc7'] = DenseLayer(net['fc6_dropout'], num_units=4096)

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/layers/dense.pyc in init(self, incoming, num_units, W, b, nonlinearity, **kwargs)
69 num_inputs = int(np.prod(self.input_shape[1:]))
70
---> 71 self.W = self.add_param(W, (num_inputs, num_units), name="W")
72 if b is None:
73 self.b = None

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/layers/base.pyc in add_param(self, spec, shape, name, **tags)
212 name = "%s.%s" % (self.name, name)
213 # create shared variable, or pass through given variable/expression
--> 214 param = utils.create_param(spec, shape, name)
215 # parameters should be trainable and regularizable by default
216 tags['trainable'] = tags.get('trainable', True)

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/utils.pyc in create_param(spec, shape, name)
349
350 elif hasattr(spec, 'call'):
--> 351 arr = spec(shape)
352 try:
353 arr = floatX(arr)

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/init.pyc in call(self, shape)
29 their :meth:sample() method.
30 """
---> 31 return self.sample(shape)
32
33 def sample(self, shape):

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/init.pyc in sample(self, shape)
175
176 std = self.gain * np.sqrt(2.0 / ((n1 + n2) * receptive_field_size))
--> 177 return self.initializer(std=std).sample(shape)
178
179

/home/roman/anaconda/lib/python2.7/site-packages/lasagne/init.pyc in sample(self, shape)
98 def sample(self, shape):
99 return floatX(get_rng().uniform(
--> 100 low=self.range[0], high=self.range[1], size=shape))
101
102

mtrand.pyx in mtrand.RandomState.uniform (numpy/random/mtrand/mtrand.c:13575)()

mtrand.pyx in mtrand.cont2_array_sc (numpy/random/mtrand/mtrand.c:2902)()

MemoryError:

There is a second computer RAM 32 Gb 64bit
on this computer is working correctly
i.e. 16 GB RAM is not enough
is it normal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions