Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workshop_tutorial.ipynb throwing ValueError #51

Open
jeffmylife opened this issue May 29, 2018 · 1 comment
Open

workshop_tutorial.ipynb throwing ValueError #51

jeffmylife opened this issue May 29, 2018 · 1 comment

Comments

@jeffmylife
Copy link

Went through the workshop_tutorial.ipynb without changing anything, but am getting a ValueError.

This is the line initiating the error:

one_filter_dragonn = get_SequenceDNN(one_filter_dragonn_parameters)


ValueError Traceback (most recent call last)
in ()
----> 1 one_filter_dragonn = get_SequenceDNN(one_filter_dragonn_parameters)

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/dragonn/tutorial_utils.pyc in get_SequenceDNN(SequenceDNN_parameters)
80
81 def get_SequenceDNN(SequenceDNN_parameters):
---> 82 return SequenceDNN(**SequenceDNN_parameters)
83
84

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/dragonn/models.pyc in init(self, seq_length, use_deep_CNN, use_RNN, num_tasks, num_filters, conv_width, num_filters_2, conv_width_2, num_filters_3, conv_width_3, pool_width, L1, dropout, GRU_size, TDD_size, verbose)
129 nb_filter=num_filters, nb_row=4,
130 nb_col=conv_width, activation='linear',
--> 131 init='he_normal', input_shape=self.input_shape))
132 self.model.add(Activation('relu'))
133 self.model.add(Dropout(dropout))

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/layers/convolutional.py in init(self, nb_filter, nb_row, nb_col, init, activation, weights, border_mode, subsample, dim_ordering, W_regularizer, b_regularizer, activity_regularizer, W_constraint, b_constraint, **kwargs)
253 self.initial_weights = weights
254 self.input = K.placeholder(ndim=4)
--> 255 super(Convolution2D, self).init(**kwargs)
256
257 def build(self):

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/layers/core.py in init(self, **kwargs)
49 self.set_input_shape(tuple(kwargs['batch_input_shape']))
50 elif 'input_shape' in kwargs:
---> 51 self.set_input_shape((None,) + tuple(kwargs['input_shape']))
52 self.trainable = True
53 if 'trainable' in kwargs:

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/layers/core.py in set_input_shape(self, input_shape)
155 self._input_shape = input_shape
156 self.input = K.placeholder(shape=self._input_shape)
--> 157 self.build()
158
159 @Property

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/layers/convolutional.py in build(self)
264 else:
265 raise Exception('Invalid dim_ordering: ' + self.dim_ordering)
--> 266 self.W = self.init(self.W_shape)
267 self.b = K.zeros((self.nb_filter,))
268 self.trainable_weights = [self.W, self.b]

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/initializations.py in he_normal(shape, name)
46 ''' Reference: He et al., http://arxiv.org/abs/1502.01852
47 '''
---> 48 fan_in, fan_out = get_fans(shape)
49 s = np.sqrt(2. / fan_in)
50 return normal(shape, s, name=name)

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/Keras-0.3.2-py2.7.egg/keras/initializations.py in get_fans(shape)
5
6 def get_fans(shape):
----> 7 fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])
8 fan_out = shape[1] if len(shape) == 2 else shape[0]
9 return fan_in, fan_out

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in prod(a, axis, dtype, out, keepdims)
2564
2565 return _methods._prod(a, axis=axis, dtype=dtype,
-> 2566 out=out, **kwargs)
2567
2568

/Users/jeffrey/anaconda2/lib/python2.7/site-packages/numpy/core/_methods.pyc in _prod(a, axis, dtype, out, keepdims)
33
34 def _prod(a, axis=None, dtype=None, out=None, keepdims=False):
---> 35 return umr_prod(a, axis, dtype, out, keepdims)
36
37 def _any(a, axis=None, dtype=None, out=None, keepdims=False):

ValueError: setting an array element with a sequence.

Any help would be appreciated.
Thanks 

@ahorvath
Copy link

ahorvath commented Dec 3, 2018

I got the same issue. Any suggestion?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants