Skip to content

AttributeError: 'Dense' object has no attribute 'b' #4

@yanshengjia

Description

@yanshengjia

When I run "python train_nea.py -tr data/fold_0/train.tsv -tu data/fold_0/dev.tsv -ts data/fold_0/test.tsv -p 1 -o output"

I got an error like this:

/Users/yanshengjia/Desktop/aes/nea/nea/models.py:63: UserWarning: Update your LSTM call to the Keras 2 API: LSTM(300, return_sequences=True, dropout=0.5, recurrent_dropout=0.1)
model.add(RNN(args.rnn_dim, return_sequences=True, dropout_W=dropout_W, dropout_U=dropout_U))
/Users/yanshengjia/anaconda/lib/python2.7/site-packages/keras/engine/topology.py:621: UserWarning: Class nea.my_layers.MeanOverTime defines get_output_shape_for but does not override compute_output_shape. If this is a Keras 1 layer, please implement compute_output_shape to support Keras 2.
output_shape = self.compute_output_shape(input_shape)
Traceback (most recent call last):
File "train_nea.py", line 160, in
model = create_model(args, train_y.mean(axis=0), overal_maxlen, vocab)
File "/Users/yanshengjia/Desktop/aes/nea/nea/models.py", line 73, in create_model
model.layers[-1].b.set_value(bias_value)
AttributeError: 'Dense' object has no attribute 'b'

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