Skip to content

An example of migrating a custom mobilenet-based model from Tensorflow to Tensorflow.js

Notifications You must be signed in to change notification settings

markstrefford/tf-to-tfjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Converting TF model to TF.js

This repo walks through the approach of migrating a custom model from Tensorflow to tensorflow.js

Approach:

  1. Use transfer learning from mobilenet to a custom model
  2. Convert to tf.js layers model
  3. Deploy to the browser

Current issues

This current approach is giving the following error when loading the converted model using tf.js:

Uncaught (in promise) Error: Unknown layer: Functional. This may be due to one of the following reasons:
1. The layer is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.
2. The custom layer is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().
    at new ValueError (index.js:58562)
    at deserializeKerasObject (index.js:58821)
    at deserialize (index.js:63305)
    at index.js:68775
    at step (index.js:58480)
    at Object.next (index.js:58461)
    at fulfilled (index.js:58451)

About

An example of migrating a custom mobilenet-based model from Tensorflow to Tensorflow.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published