question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import pretrained models from keras.applications

See original GitHub issue

TensorFlow.js version 0.6.1

Browser version Google Chrome | 65.0.3325.181

Describe the problem

Uncaught (in promise) Error: Unknown layer: SeparableConv2D
    at new t (tfjs@0.6.1:1)
    at Object.n.deserializeKerasObject (tfjs@0.6.1:1)
    at Object.n.deserialize (tfjs@0.6.1:1)
    at p (tfjs@0.6.1:1)
    at t.fromConfig (tfjs@0.6.1:1)
    at Object.n.deserializeKerasObject (tfjs@0.6.1:1)
    at Object.n.deserialize (tfjs@0.6.1:1)
    at tfjs@0.6.1:1
    at r (tfjs@0.6.1:1)
    at Object.next (tfjs@0.6.1:1)
t @ tfjs@0.6.1:1
n.deserializeKerasObject @ tfjs@0.6.1:1
n.deserialize @ tfjs@0.6.1:1
p @ tfjs@0.6.1:1
t.fromConfig @ tfjs@0.6.1:1
n.deserializeKerasObject @ tfjs@0.6.1:1
n.deserialize @ tfjs@0.6.1:1
(anonymous) @ tfjs@0.6.1:1
r @ tfjs@0.6.1:1
(anonymous) @ tfjs@0.6.1:1
(anonymous) @ tfjs@0.6.1:1
o @ tfjs@0.6.1:1
r @ tfjs@0.6.1:1
(anonymous) @ tfjs@0.6.1:1
r @ tfjs@0.6.1:1
(anonymous) @ tfjs@0.6.1:1
o @ tfjs@0.6.1:1
Promise.then (async)
(anonymous) @ app.js:2

Code to reproduce the bug

from keras.applications.xception import Xception
import tensorflowjs as tfjs

model = Xception(weights='imagenet', include_top=False)
tfjs.converters.save_keras_model(model, '/app/data/xception')
tf.loadModel('xception/model.json')
  .then(model => {
    console.log(model);
  })

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
caisqcommented, Apr 4, 2018

There are two issues here:

  1. SeparableConv2D is not implemented yet
  2. The same issue as https://github.com/tensorflow/tfjs/issues/84, related to the padding config key.

I plan to fix 2 soon. I’ll look into 1 later.

0reactions
caisqcommented, Apr 9, 2018

Heads-up: I’m working on separableConv2d in tfjs-core and SeparableConv2D in tfjs-layers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras Applications
Model Size (MB) Top‑1 Accuracy Top‑5 Accuracy Parameters Depth Time (ms) per infer... Xception 88 79.0% 94.5% 22.9M 81 109.4 VGG16 528 71.3% 90.1% 138.4M...
Read more >
A Simple Guide to Using Keras Pretrained Models
All pretrained models are available in the application module of Keras. First, we have to import pretrained models as follows.
Read more >
Transfer Learning in Keras with Computer Vision Models
The pre-trained model can be used as a separate feature extraction program, in which case input can be pre-processed by the model or...
Read more >
Keras - Applications - Tutorialspoint
Keras applications module is used to provide pre-trained model for deep neural networks. Keras models are used for prediction, feature extraction and fine ......
Read more >
Module: tf.keras.applications | TensorFlow v2.11.0
Keras Applications are premade architectures with pre-trained weights.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found