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

tf.one_hot crashes when indices is tf.uint8 #26099

Closed
TomoshibiAkira opened this issue Feb 25, 2019 · 4 comments
Closed

tf.one_hot crashes when indices is tf.uint8 #26099

TomoshibiAkira opened this issue Feb 25, 2019 · 4 comments
Assignees
Labels
comp:ops OPs related issues type:bug Bug

Comments

@TomoshibiAkira
Copy link

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
    Yes.
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04 / Windows 7
  • TensorFlow installed from (source or binary): Official pip source (tensorflow-gpu)
  • TensorFlow version (use command below): 1.12.0
  • Python version: 3.6
  • CUDA/cuDNN version: 9.0 / 7.5
  • GPU model and memory: 1080Ti / 12GB

Describe the current behavior
tf.one_hot crashes when the indices tensor has dtype=tf.uint8
The error message shows Check failed: new_num_elements == NumElements()

Code to reproduce the issue
https://gist.github.com/elmirador/4fc5148e5044478d668237209d265eac

Other info / logs
I've also tested under TF 1.4.1 and TF 1.10.0 (both on GPU) on different machines, both have the same problem.

@jvishnuvardhan jvishnuvardhan self-assigned this Feb 26, 2019
@jvishnuvardhan jvishnuvardhan added comp:ops OPs related issues type:bug Bug labels Feb 26, 2019
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 26, 2019
@bono1567
Copy link

bono1567 commented Mar 1, 2019

Hello, I am new to the tensorflow community and which going thorugh the code I couldn't find gen_array_ops. If possible I would like to contribute to the issue.

@TomoshibiAkira
Copy link
Author

TomoshibiAkira commented Mar 1, 2019

Hello, I am new to the tensorflow community and which going thorugh the code I couldn't find gen_array_ops. If possible I would like to contribute to the issue.

gen_array_ops.py is located under tensorflow/python/ops/.
You can't find it on github because gen_array_ops is generated during building.
Basically it's a wrapper around the underlying C++ code of tensorflow. If you're interested, the C++ code of one_hot ops is located at tensorflow/core/kernels/one_hot_op.cc.

@annarev
Copy link
Contributor

annarev commented Apr 23, 2019

@bono1567 Don't know if you had a chance to look into it and thank you for your interest!
Since you haven't posted an update for a while and I just looked into it, I will submit a fix now.

@tensorflow-bot
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@jvishnuvardhan jvishnuvardhan removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:ops OPs related issues type:bug Bug
Projects
None yet
Development

No branches or pull requests

4 participants