Closed arushk1 closed 9 years ago
You got this error without making any changes to the script?
Yes. No changes at all
I'm unable to reproduce this error on my side. Are you using the same versions of Keras/Theano as I have highlighted in my README? Try this simple Keras example:
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
model = Sequential()
# Dense(64) is a fully-connected layer with 64 hidden units.
# in the first layer, you must specify the expected input data shape:
# here, 20-dimensional vectors.
model.add(Dense(64, input_dim=20, init='uniform'))
model.add(Activation('tanh'))
model.add(Dropout(0.5))
model.add(Dense(64, init='uniform'))
model.add(Activation('tanh'))
model.add(Dropout(0.5))
model.add(Dense(2, init='uniform'))
model.add(Activation('softmax'))
sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(loss='mean_squared_error', optimizer=sgd)
This is straight from the Keras README.
Yeah. This does not run. That's odd. I have used keras before... Let me check
Yeah. It was a Keras problem. Someone had opened the same issue on Keras repo. Fixed now.
$ python trainMLP.py loaded vgg features loaded word2vec features... Traceback (most recent call last): File "trainMLP.py", line 114, in
main()
File "trainMLP.py", line 62, in main
model.add(Dense(args.num_hidden_units, input_dim=img_dim+word_vec_dim, init='uniform'))
TypeError: init() got multiple values for keyword argument 'input_dim'
Not able to understand this. Seems fine to me. This is the way I'd do it. Insights?