keplr-io / hera

Train/evaluate a Keras model, get metrics streamed to a dashboard in your browser.
MIT License
488 stars 47 forks source link

Error on fit #9

Closed bkj closed 8 years ago

bkj commented 8 years ago

I'm getting an error from the following code -- any idea what's going on?

import numpy as np

from keras.models import Sequential
from keras.layers import Dense

from heraspy.model import HeraModel
hera_model = HeraModel({'id': 'my-model'}, {'domain': 'localhost', 'port': 4000})

X = np.random.uniform(0, 1, (100000, 100))
y = np.random.choice((0, 1), 100000)

model = Sequential()
model.add(Dense(1, input_shape=(100,)))
model.compile(loss='binary_crossentropy', optimizer='rmsprop', metrics=['accuracy'])

model.fit(X, y, verbose=True, callbacks=[hera_model])

(I'm running keras version 1.0.5)

Thanks Ben

bkj commented 8 years ago

My mistake -- I used

model.fit(X, y, verbose=True, callbacks=[hera_model])

instead of

model.fit(X, y, verbose=True, callbacks=[hera_model.callback])