Topic: https://intoli.com/blog/keras-weight-transfer/
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 265d ago

wget https://raw.githubusercontent.com/transcranial/keras-js/master/encoder.py - this link doesnt exist. can you help out.

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 6y, 263d ago [edited]

Thanks for pointing that out. You can grab encoder.py from the 0.3.0 Keras.js release using

wget https://raw.githubusercontent.com/transcranial/keras-js/2c97e25d9237eff4033ec52b0b37422abc45e503/encoder.py

I've also updated the article with up-to-date instructions.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 233d ago

Hi, nice article but i got one problem...

When I do your script, he told me :

Uncaught Error: [Model] path to protobuf-serialized model definition file is missing. at new t (keras.min.js:1) at window.onload ((index):115)

How can I solve the problem ? Thanks

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 6y, 229d ago

That particular error shows up because the filenames option of Model from keras-js got renamed to filename. The path you provide there should point to a binary model file. I updated the article explaining how to produce the model file for the newest version keras-js, and added a working project to our article materials repo.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 315d ago

I am new to keras.js. How exactly do I have to run it after having all the files and installing all the required?

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 5y, 310d ago

The example here uses only a development Webpack config which creates a bundle that is injected into a HTML webpage dynamically. To get this to work on any website, you'd need to either adapt the Webpack config to create a production bundle that you would then load from your webpage, or you would load Keras.js separately and use the global KerasJS object; see https://transcranial.github.io/keras-js-docs/setup/browser/.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 313d ago

I got one problem with that: I have found the following decision,

Project is running at http://localhost:3000/ webpack output is served from / Content not from webpack is served from /home/kidane/Documents/keras-weight-transfer/frontend/bundle 404s will fallback to /index.html Hash: 7e6e48eb9ec089832555

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 5y, 310d ago

See comment https://my.remarkbox.com/r/b8a9d9ee-0008-11e9-b437-040140774501 which talks about the same thing.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 313d ago

Really nice article. But I facing one problem. I did everything as you have specified , but I got the following result.

webpack output is served from /

Content not from webpack is served from /home/kidane/Documents/keras-weight-transfer/frontend/build

404s will fallback to /index.html

It got stuck on loading with no content. I tried to change the folder where the server got reserved , but nothing change.

Would you help me please

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 5y, 310d ago [edited]

I'm not 100% clear on what issue you're facing, but during development you can control the URL root and how links are displayed using the publicPath and contentBase keys of the devServer property of the Webpack config. Try changing these until the project works with your setup. The details will generally depend on your particular setup, if it differs from the one supplied in the accompanying article materials.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 171d ago

when I use keras-js to build my project, I met a big problem, when I encoder hdf5 file, it raises KeyError: "Can't open attribute (can't locate attribute: 'model_config')", and when I use the latest version encoder to transfer my hdf5 file, I successfully get three files, but occurring another error :[Model] path to protobuf-serialized model definition file is missing. so now I have no idea how to continue my project.hopeful for your answer.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 301d ago

I noticed that you passed in a data sample that is basically a flattened 2D array. My model takes in 3D images as input, but I don't understand where I'm supposed to specify the height, width, channel specifications in my prediction function. Am I overthinking this or how do we enforce that constraint?

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 5y, 298d ago [edited]

It's been a while, so I'm a little rusty, but based on the Usage page of the docs, your inputs should be objects of flattened arrays with keys corresponding to names of the input layers. The dimensions are specified in the model config, so you can check there for hints.

hide preview

What's next? verify your email address for reply notifications!

lX3CJRsx 5y, 289d ago

After saving the model as .h5 file and converting it to a .bin , I get following error while loading it:

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

I have tried with different keras versions. What could be the problem? thanks

remark link
hide preview

What's next? verify your email address for reply notifications!

andre 5y, 286d ago

I had issues with transferring the weights to the browser when using mismatched library versions. I recommend using exactly the versions I'm using in the article and seeing if that works.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 284d ago

thanks for your help. But still I am getting an error.

TypeError: layer.layer is undefined

hide preview

What's next? verify your email address for reply notifications!