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.

Error: Unkown value 3,3,3,3 for padding Enum in tf.loadModel

See original GitHub issue

Hello,

I have exported successfully my Keras model using the tensorflowjs_converter without any error or warning. However, when I try to load the model using tf.loadModel(‘model.json’), I get the following error:

Uncaught (in promise) Error: Unkown value 3,3,3,3 for padding Enum
    at new t (tf.min.js:1)
    at i (tf.min.js:1)
    at i (tf.min.js:1)
    at i (tf.min.js:1)
    at i (tf.min.js:1)
    at Object.i [as convertPythonicToTs] (tf.min.js:1)
    at tf.min.js:1
    at r (tf.min.js:1)
    at Object.next (tf.min.js:1)
    at tf.min.js:1

I use the following Keras layers: BatchNormalization, Conv2D, Activation(‘relu’), ZeroPadding2D, MaxPooling2D. Also the following Keras operation: keras.layers.add. Is this due to a layer not implemented yet in tensorflowjs? I am using tensorflow 1.7, Keras 2.1.5 and tensorflowjs 0.1.0 Also, I found here the operations and layers supported from Tensorflow, where could I find the same for Keras?

Thanks a lot

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ericdnielsencommented, Apr 4, 2018

I’ve identified two issues:

  1. ZeroPadding2D wasn’t implemented.
  2. The error message is bad, because all layers that were implemented use the padding keyword to map to a string (same, valid, casual) so we converted padding to an Enum internally for stronger type. The ZeroPadding2D layers uses ‘padding’ as a key to a multi-dimensional array, and thus breaks the mapping of value to enum.
0reactions
scaellescommented, Apr 5, 2018

Perfect, thanks a lot for fixing it so quickly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for unknown enum values · Issue #284 - GitHub
Problem : whenever server returns new unsupported by client enum value it's a breaking change, as we force cast the raw string value...
Read more >
Can you define an enum to represent values explicitly known ...
The trick is to define one additional case, unknown with an associated value of type RawValue . This new case handles all the...
Read more >
UnknownValueImplementation Property - Business Central
Remarks. The UnknownValueImplementation property applies to enums. Uninstalling enum extensions can result in persisted values becoming unknown.
Read more >
enum — Support for enumerations — Python 3.11.1 ...
Instances are replaced with an appropriate value for Enum members. ... Enum class decorator that ensures only one name is bound to any...
Read more >
ENUM - MariaDB Knowledge Base
A string object that can have only one value, chosen from the list of values 'value1', 'value2', ..., NULL or the special ''...
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