{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3703","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3703/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3703/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3703/events","html_url":"https://github.com/tensorflow/tensorflow/issues/3703","id":170075733,"number":3703,"title":"tf.contrib.learn.TensorFlowRNNRegressor: \"inputs must be a list!\"","user":{"login":"zhedongzheng","id":16261331,"avatar_url":"https://avatars.githubusercontent.com/u/16261331?v=3","gravatar_id":"","url":"https://api.github.com/users/zhedongzheng","html_url":"https://github.com/zhedongzheng","followers_url":"https://api.github.com/users/zhedongzheng/followers","following_url":"https://api.github.com/users/zhedongzheng/following{/other_user}","gists_url":"https://api.github.com/users/zhedongzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/zhedongzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhedongzheng/subscriptions","organizations_url":"https://api.github.com/users/zhedongzheng/orgs","repos_url":"https://api.github.com/users/zhedongzheng/repos","events_url":"https://api.github.com/users/zhedongzheng/events{/privacy}","received_events_url":"https://api.github.com/users/zhedongzheng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/awaiting%20response","name":"awaiting response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-09T03:47:33Z","updated_at":"2016-08-10T20:48:34Z","closed_at":null,"body":"> import numpy as np\r\n> from tensorflow.contrib.learn import TensorFlowRNNRegressor\r\n> import tensorflow as tf\r\n> X = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]\r\n> y = [1, 1, 1]\r\n> regr = TensorFlowRNNRegressor(rnn_size=5)\r\n> regr.fit(np.array(X), np.array(y))\r\n\r\n**throws error:\r\nTraceback (most recent call last):\r\n  File \"rnn_test.py\", line 9, in <module>\r\n    regr.fit(np.array(X), np.array(y))\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py\", line 160, in fit\r\n    monitors=monitors)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py\", line 449, in _train_model\r\n    train_op, loss_op = self._get_train_ops(features, targets)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py\", line 673, in _get_train_ops\r\n    _, loss, train_op = self._call_model_fn(features, targets, ModeKeys.TRAIN)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py\", line 656, in _call_model_fn\r\n    features, targets, mode=mode)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py\", line 369, in _model_fn\r\n    predictions, loss = model_fn(features, targets)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/rnn.py\", line 205, in _model_fn\r\n    self.initial_state)(X, y)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/models.py\", line 399, in rnn_estimator\r\n    initial_state=initial_state)\r\n  File \"/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/rnn.py\", line 98, in rnn\r\n    raise TypeError(\"inputs must be a list\")\r\nTypeError: inputs must be a list**\r\n\r\nBut no problem with DNNRegressor\r\nThank you in advance for your time"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/238999332","html_url":"https://github.com/tensorflow/tensorflow/issues/3703#issuecomment-238999332","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3703","id":238999332,"user":{"login":"jayswinney","id":6809524,"avatar_url":"https://avatars.githubusercontent.com/u/6809524?v=3","gravatar_id":"","url":"https://api.github.com/users/jayswinney","html_url":"https://github.com/jayswinney","followers_url":"https://api.github.com/users/jayswinney/followers","following_url":"https://api.github.com/users/jayswinney/following{/other_user}","gists_url":"https://api.github.com/users/jayswinney/gists{/gist_id}","starred_url":"https://api.github.com/users/jayswinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayswinney/subscriptions","organizations_url":"https://api.github.com/users/jayswinney/orgs","repos_url":"https://api.github.com/users/jayswinney/repos","events_url":"https://api.github.com/users/jayswinney/events{/privacy}","received_events_url":"https://api.github.com/users/jayswinney/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T20:48:34Z","updated_at":"2016-08-10T20:48:34Z","body":"```\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-14-eeb41cd0423a> in <module>()\r\n      2 y = [1, 1, 1]\r\n      3 regr = TensorFlowRNNRegressor(rnn_size=5)\r\n----> 4 regr.fit(tf.unpack(np.array(X), axis=1), tf.unpack(np.array(y), axis=0))\r\n\r\n/home/jay/.local/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/base.py in fit(self, x, y, steps, monitors, logdir)\r\n    160       self._model_dir = logdir\r\n    161     self._data_feeder = setup_train_data_feeder(\r\n--> 162         x, y, n_classes=self.n_classes, batch_size=self.batch_size)\r\n    163     self._train_model(input_fn=self._data_feeder.input_builder,\r\n    164                       feed_fn=self._data_feeder.get_feed_dict_fn(),\r\n\r\n/home/jay/.local/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py in setup_train_data_feeder(x, y, n_classes, batch_size, shuffle, epochs)\r\n    114     return StreamingDataFeeder(x, y, n_classes, batch_size)\r\n    115   return data_feeder_cls(\r\n--> 116       x, y, n_classes, batch_size, shuffle=shuffle, epochs=epochs)\r\n    117 \r\n    118 \r\n\r\n/home/jay/.local/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py in __init__(self, x, y, n_classes, batch_size, shuffle, random_state, epochs)\r\n    236       output_dtype: dtype of output.\r\n    237     \"\"\"\r\n--> 238     x_dtype = np.int64 if x.dtype == np.int64 else np.float32\r\n    239     y_dtype = (\r\n    240         np.int64 if n_classes is not None and n_classes > 1 else np.float32)\r\n\r\nAttributeError: 'list' object has no attribute 'dtype'\r\n```"}}
{"actor":{"display_login":"jayswinney"}}