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.

'EnumTypeWrapper' object has no attribute 'DT_FLOAT' while importing in Python 3

See original GitHub issue

TensorFlow.js version

1.2.9

Browser version

Does not matter

Describe the problem or feature request

While importing tensorflowjs module in python3 (using Google Colab environment), I get the following error:

`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-4aa5f30b4c2f> in <module>() 1 from google.colab import drive 2 from google.colab import files ----> 3 import tensorflowjs as tfjs 4 5 drive.mount(‘/content/gdrive’)

4 frames /usr/local/lib/python3.6/dist-packages/tensorflowjs/init.py in <module>() 19 20 # pylint: disable=unused-imports —> 21 from tensorflowjs import converters 22 from tensorflowjs import quantization 23 from tensorflowjs import version

/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/init.py in <module>() 22 from tensorflowjs.converters.keras_tfjs_loader import deserialize_keras_model 23 from tensorflowjs.converters.keras_tfjs_loader import load_keras_model —> 24 from tensorflowjs.converters.tf_saved_model_conversion_v2 import convert_tf_saved_model

/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py in <module>() 39 from tensorflowjs.converters import common 40 from tensorflowjs.converters import fold_batch_norms —> 41 from tensorflowjs.converters import fuse_prelu 42 43 # enable eager execution for v2 APIs

/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/fuse_prelu.py in <module>() 198 prelu_fn(tf.constant(1.0), tf.constant(1.0)) 199 –> 200 register_prelu_op()

/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/fuse_prelu.py in register_prelu_op() 40 41 value = attr_value_pb2.AttrValue() —> 42 value.list.type.extend([types_pb2.DataType.DT_FLOAT]) 43 attr = op_def_pb2.OpDef.AttrDef() 44 attr.name = ‘T’

AttributeError: ‘EnumTypeWrapper’ object has no attribute ‘DT_FLOAT’ `

Code to reproduce the bug / link to feature request

You can try it on Google Colab. https://colab.research.google.com/drive/1gftM84djEwrxNfgqbriIzxatI5S_p9aX

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

2reactions
ghafrancommented, Sep 15, 2019

pip install tensorflowjs==1.2.6 seems to fix this issue.

2reactions
pedrohbtpcommented, Sep 14, 2019

I tried it with version 1.2.6 and it does not have this error. 1.2.9 has

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Python 3.6.1 throws AttributeError: module 'enum' has no ...
I got this error running Flask under PyCharm, and fixed it by disabling AppEngine support from the project (Preferences -> Languages & Frameworks...
Read more >
EnumTypeWrapper JSON Issue - Discuss Dgraph
What I want to do I am having the exact same problem as Python Insert ... AttributeError: 'EnumTypeWrapper' object has no attribute 'JSON'...
Read more >
Issue 43162: Enum regression: AttributeError when accessing ...
While in Python 3.10.0a5: >>> import enum >>> class C(enum. ... And it fails with: AttributeError: TestProtocol: no attribute 'EXITCODE' ...
Read more >
protobuf/python/google/protobuf/internal/enum_type_wrapper.py
"""A simple wrapper around enum types to expose utility functions. Instances are created as properties with the same name as the enum they...
Read more >
google.protobuf.internal.enum_type_wrapper
Also exporting a class-level object that can name enum values. ... EnumTypeWrapper(enum_type)) for enum_value in enum_type.values: ... Example #3 ...
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