{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22171","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22171/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22171/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22171/events","html_url":"https://github.com/tensorflow/tensorflow/issues/22171","id":358375871,"node_id":"MDU6SXNzdWUzNTgzNzU4NzE=","number":22171,"title":"Elements of a CsvDataset should be tensors instead of tuples","user":{"login":"mattscar","id":173746,"node_id":"MDQ6VXNlcjE3Mzc0Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/173746?v=4","gravatar_id":"","url":"https://api.github.com/users/mattscar","html_url":"https://github.com/mattscar","followers_url":"https://api.github.com/users/mattscar/followers","following_url":"https://api.github.com/users/mattscar/following{/other_user}","gists_url":"https://api.github.com/users/mattscar/gists{/gist_id}","starred_url":"https://api.github.com/users/mattscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattscar/subscriptions","organizations_url":"https://api.github.com/users/mattscar/orgs","repos_url":"https://api.github.com/users/mattscar/repos","events_url":"https://api.github.com/users/mattscar/events{/privacy}","received_events_url":"https://api.github.com/users/mattscar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"rachellim","id":9589037,"node_id":"MDQ6VXNlcjk1ODkwMzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9589037?v=4","gravatar_id":"","url":"https://api.github.com/users/rachellim","html_url":"https://github.com/rachellim","followers_url":"https://api.github.com/users/rachellim/followers","following_url":"https://api.github.com/users/rachellim/following{/other_user}","gists_url":"https://api.github.com/users/rachellim/gists{/gist_id}","starred_url":"https://api.github.com/users/rachellim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachellim/subscriptions","organizations_url":"https://api.github.com/users/rachellim/orgs","repos_url":"https://api.github.com/users/rachellim/repos","events_url":"https://api.github.com/users/rachellim/events{/privacy}","received_events_url":"https://api.github.com/users/rachellim/received_events","type":"User","site_admin":false},"assignees":[{"login":"rachellim","id":9589037,"node_id":"MDQ6VXNlcjk1ODkwMzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9589037?v=4","gravatar_id":"","url":"https://api.github.com/users/rachellim","html_url":"https://github.com/rachellim","followers_url":"https://api.github.com/users/rachellim/followers","following_url":"https://api.github.com/users/rachellim/following{/other_user}","gists_url":"https://api.github.com/users/rachellim/gists{/gist_id}","starred_url":"https://api.github.com/users/rachellim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachellim/subscriptions","organizations_url":"https://api.github.com/users/rachellim/orgs","repos_url":"https://api.github.com/users/rachellim/repos","events_url":"https://api.github.com/users/rachellim/events{/privacy}","received_events_url":"https://api.github.com/users/rachellim/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-09-09T12:46:50Z","updated_at":"2018-10-10T12:41:01Z","closed_at":null,"author_association":"NONE","body":"------------------------\r\n\r\n### System information\r\n- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): **Yes**\r\n- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): **Linux Ubuntu 18.04**\r\n- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: **No**\r\n- TensorFlow installed from (source or binary): **source**\r\n- TensorFlow version (use command below): **1.10**\r\n- Python version: **3.6**\r\n- Bazel version (if compiling from source): **0.16.1**\r\n- GCC/Compiler version (if compiling from source): **7.3.0**\r\n- CUDA/cuDNN version: **N/A**\r\n- GPU model and memory: **N/A**\r\n- Exact command to reproduce:\r\n\r\n### Describe the problem\r\nAccording to the [tf.data.Dataset](https://www.tensorflow.org/api_docs/python/tf/data/Dataset) documentation, the elements of a generated dataset are expected to be tensors or sparse tensors. But when you create a [CsvDataset](https://www.tensorflow.org/api_docs/python/tf/contrib/data/CsvDataset), the elements are tuples. As a result, the dataset methods behave strangely.\r\n\r\n### Source code / logs\r\nAssume the file example.csv contains this text:\r\n```\r\n1.0,2.0,3.0\r\n4.0,5.0,6.0\r\n```\r\n\r\nThis code creates a CsvDataset and calls batch to combine elements into batches:\r\n```\r\nds1 = tf.contrib.data.CsvDataset('example.csv', [tf.float32, tf.float32, tf.float32])\r\nds2 = ds1.batch(2)\r\niter = ds2.make_one_shot_iterator()\r\nwith tf.Session() as sess:\r\n    while True:            \r\n        try:\r\n          print(sess.run(iter.get_next()))\r\n        except tf.errors.OutOfRangeError:\r\n          break\r\n```\r\n\r\nThe application prints the following result for ds2:\r\n```(array([1., 4.], dtype=float32), array([2., 5.], dtype=float32), array([3., 6.], dtype=float32))```\r\n\r\nThe elements don't form expected batches because the elements of ds1 are tuples instead of tensors.\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/428556053","html_url":"https://github.com/tensorflow/tensorflow/issues/22171#issuecomment-428556053","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22171","id":428556053,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODU1NjA1Mw==","user":{"login":"tensorflowbutler","id":28546240,"node_id":"MDQ6VXNlcjI4NTQ2MjQw","avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T12:41:01Z","updated_at":"2018-10-10T12:41:01Z","author_association":"MEMBER","body":"Nagging Assignee @rachellim: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly."}}
{"actor":{"display_login":"tensorflowbutler"}}