Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mrqo opened this issue Sep 11, 2019 · 8 comments
Closed
Assignees
Labels
type:bug Something isn't working

Comments

@mrqo
Copy link

mrqo commented Sep 11, 2019

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)
in ()
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 ()
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 ()
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 ()
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 ()
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

@rthadur rthadur added the type:bug Something isn't working label Sep 11, 2019
@rthadur
Copy link
Contributor

rthadur commented Sep 11, 2019

seems to be a bug , @pyu10055 can you please take a look ?

@saeedmarzban
Copy link

AttributeError: 'EnumTypeWrapper' object has no attribute 'DT_FLOAT'

Same problem

@cnrblm
Copy link

cnrblm commented Sep 12, 2019

+1

@pedrohbtp
Copy link

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

@ghafran
Copy link

ghafran commented Sep 15, 2019

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

@pyu10055
Copy link
Collaborator

I believe this is fixed by this PR dd5d9ed

you should see the changes in next release.

@dimitri320
Copy link

on version 1.2.6 I get this error:

ValueError: tf.enable_eager_execution must be called at program startup.

@carlos-aguayo
Copy link

"pip install tensorflowjs==1.2.6" worked for me, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants