{"action":"opened","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3165","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3165/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3165/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/3165/events","html_url":"https://github.com/tensorflow/tensorflow/issues/3165","id":163549890,"number":3165,"title":"AttributeError: 'Tensor' object has no attribute 'shape'","user":{"login":"dtracers","id":1933836,"avatar_url":"https://avatars.githubusercontent.com/u/1933836?v=3","gravatar_id":"","url":"https://api.github.com/users/dtracers","html_url":"https://github.com/dtracers","followers_url":"https://api.github.com/users/dtracers/followers","following_url":"https://api.github.com/users/dtracers/following{/other_user}","gists_url":"https://api.github.com/users/dtracers/gists{/gist_id}","starred_url":"https://api.github.com/users/dtracers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtracers/subscriptions","organizations_url":"https://api.github.com/users/dtracers/orgs","repos_url":"https://api.github.com/users/dtracers/repos","events_url":"https://api.github.com/users/dtracers/events{/privacy}","received_events_url":"https://api.github.com/users/dtracers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-03T06:34:24Z","updated_at":"2016-07-03T06:34:24Z","closed_at":null,"body":"### Environment info\r\nOperating System:  BashOn Windows\r\n\r\nInstalled version of CUDA and cuDNN: \r\n(doesnt matter CPU version only)\r\n\r\nIf installed from binary pip package, provide:\r\n0.9.0\r\n\r\nIf installed from sources, provide the commit hash:\r\n\r\n### Steps to reproduce\r\n\r\n```\r\n    def create_classifier(self):\r\n        hiddenLayers = [self.num_points, self.num_points * 2, 10]\r\n        self.classifier = tf.contrib.learn.DNNClassifier(hidden_units=hiddenLayers)\r\n```\r\n\r\nlabel is a string\r\npoint list is a list of an array of x, y values\r\nex:\r\n```\r\n[[1,2],[2,3],[3,4],...]\r\n```\r\n```\r\n    def train(self, label, point_list):\r\n        points = self.resample(point_list, self.num_points)\r\n        utils.strip_ids_from_points(points)\r\n        value_class = 1 if label == self.label else 0\r\n        target = tf.reshape(tf.constant(value_class), [1])\r\n        print 'training classifier to recognize value as: [' + str(value_class) + '] label is ' + label + ' class is ' + self.label\r\n        point_tensor = tf.convert_to_tensor(points, dtype=tf.float32)\r\n        reshaped_tensor = tf.reshape(point_tensor, [1, self.num_points * 2])\r\n        print reshaped_tensor\r\n        print target\r\n        self.classifier.fit(x=reshaped_tensor, y=target, steps=1)\r\n```\r\n\r\n### What have you tried?\r\ngoogling why a tensor would not have a shape attribute\r\n\r\n### Logs or other output that would be helpful\r\n```\r\nTensor(\"Reshape_1:0\", shape=(1, 64), dtype=float32)\r\nTensor(\"Reshape:0\", shape=(1,), dtype=int32)\r\nTraceback (most recent call last):\r\n  File \"main.py\", line 6, in <module>\r\n    connection.start_socket(8089, callback=handler.message_processor)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/connection/python_socket_server.py\", line 13, in start_socket\r\n    process_message(connection, callback=callback)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/connection/python_socket_server.py\", line 38, in process_message\r\n    result = callback(general_proto)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/recognition/proto_handler.py\", line 39, in message_processor\r\n    return train_shape(general_proto.template)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/recognition/proto_handler.py\", line 23, in train_shape\r\n    rec.add_training_data(recognition_template.interpretation.label, recognition_template.shape)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/recognition/recognition_manager.py\", line 98, in add_training_data\r\n    self.recognizers[label].train(label, points)\r\n  File \"/mnt/d/workspace/SketchRecognitionWithTensorFlow/src/main/python/recognition/simple/recognizer.py\", line 78, in train\r\n    self.classifier.fit(x=reshaped_tensor, y=target, steps=1)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py\", line 173, in fit\r\n    input_fn, feed_fn = _get_input_fn(x, y, batch_size)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py\", line 67, in _get_input_fn\r\n    x, y, n_classes=None, batch_size=batch_size)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/io/data_feeder.py\", line 117, in setup_train_data_feeder\r\n    X, y, n_classes, batch_size, shuffle=shuffle, epochs=epochs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/io/data_feeder.py\", line 239, in __init__\r\n    self.X.shape, None if self.y is None else self.y.shape, n_classes,\r\nAttributeError: 'Tensor' object has no attribute 'shape'\r\n```"}}
{"actor":{"display_login":"dtracers"}}