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

output_shape doesn't make sense, the output remains no structure #342

Closed
CaptainDuke opened this issue Jul 12, 2019 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@CaptainDuke
Copy link
Contributor

CaptainDuke commented Jul 12, 2019

As mentioned before, I tried to read hdf5 data using tf-io, but the output_shape doesn't make sense. ([1,8]) expected but returns ( ).

For comparing, I worte dataset2 form tf.data.Dataset.from_tensor_slices(). Also I did some tf.reshape ops, where dataset read via tf-io failed.

I thinks it's a kind of serious problem since we can not continue tf.layers.conv2d or other ops without output_shapes.

Hope this issue would be fixed. Thanks.

image
image

@CaptainDuke
Copy link
Contributor Author

Code above
issue_test.py.zip

@CaptainDuke
Copy link
Contributor Author

CaptainDuke commented Jul 15, 2019

temporary solution:
add dataset.batch() and then tf.reshape

dataset = hdf5_io.HDF5Dataset(
       [filename], columns, output_types, output_shapes)
dataset = dataset.batch(10)
iterator = dataset.make_one_shot_iterator()
get_next = iterator.get_next()

input_x = tf.reshape(get_next, output_shape)
sess = tf.Session()
vv = sess.run(tf.shape(input_x))
print(vv)

Besides, if we want to use dataset.shuffle and dataset.prefetch then, dataset.make_one_shot_iterator() works.

@yongtang
Copy link
Member

@CaptainDuke in 2.0 the output shape and dtype are implicitly probed. I believe the issue has been resolved. Will close the issue for now but feel free to reopen if issue still persists.

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

No branches or pull requests

2 participants