Rabu, 13 Maret 2019

keras-js "Error: [Model] Model configuration does not contain any layers."

Im trying to load a simple example network created with keras in the browser using keras-js. After saving the model as .h5 file and converting it to a .bin file I get following error while loading it:


*Error: [Model] Model configuration does not contain any layers.*

The model is simply created by:


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

model= Sequential()
model.add(Dense(10,input_shape=(1,)))
model.add(Activation('relu'))
model.add(Dense(1))

model.compile(optimizer='rmsprop',loss='mse',metrics=['accuracy'])

inputs=[[5],[3],[4],[5]]
targets=[[5],[3],[4],[5]]

model.fit(inputs,targets,epochs=100)
model.save("example.h5")

Then I convert it with:


python encoder.py -q example.h5

and load it in javascript with:


const model = new KerasJS.Model({
filepath: '/keras/example.bin',
filesystem: true,
gpu: false
})

I have tried it with keras version 2.0.9, 2.1.2 and 2.1.5. What could be the problem here?



from keras-js "Error: [Model] Model configuration does not contain any layers."

keras-js "Error: [Model] Model configuration does not contain any layers." Rating: 4.5 Diposkan Oleh: Admin

0 komentar:

Posting Komentar

Popular Posts