{"action":"created","issue":{"url":"https://api.github.com/repos/tflearn/tflearn/issues/195","repository_url":"https://api.github.com/repos/tflearn/tflearn","labels_url":"https://api.github.com/repos/tflearn/tflearn/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/tflearn/tflearn/issues/195/comments","events_url":"https://api.github.com/repos/tflearn/tflearn/issues/195/events","html_url":"https://github.com/tflearn/tflearn/issues/195","id":164737694,"number":195,"title":"confusing error message when looping analyses","user":{"login":"andrewljohnson","id":455551,"avatar_url":"https://avatars.githubusercontent.com/u/455551?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewljohnson","html_url":"https://github.com/andrewljohnson","followers_url":"https://api.github.com/users/andrewljohnson/followers","following_url":"https://api.github.com/users/andrewljohnson/following{/other_user}","gists_url":"https://api.github.com/users/andrewljohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewljohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewljohnson/subscriptions","organizations_url":"https://api.github.com/users/andrewljohnson/orgs","repos_url":"https://api.github.com/users/andrewljohnson/repos","events_url":"https://api.github.com/users/andrewljohnson/events{/privacy}","received_events_url":"https://api.github.com/users/andrewljohnson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-10T22:33:25Z","updated_at":"2016-08-19T17:42:21Z","closed_at":"2016-07-11T03:13:18Z","body":"I am training a shallow network for each US state. The first analysis works, the second throws the following error, when [model.fit is called in this code](https://github.com/trailbehind/DeepOSM/blob/feature/analysis-cycle/src/single_layer_network.py#L74).\r\n\r\nIt's a bit confusing that the error message relates to tensorflow instead of tflearn. Maybe tflearn should wrap _with tf.Graph().as_default()_ \r\n\r\n    File \"/DeepOSM/src/single_layer_network.py\", line 75, in train_with_data\r\n    run_id='mlp')\r\n    File \"/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py\", line 153, in fit\r\n    self.targets)\r\n    File \"/usr/local/lib/python2.7/dist-packages/tflearn/utils.py\", line 253, in feed_dict_builder\r\n    \". If you are using notebooks, please \" \r\n    Exception: 274 inputs feeded, but expected: 2. If you are using notebooks, please make sure that you didn't run graph construction cell multiple time, or try to enclose your graph within `with tf.Graph().as_default():`"},"comment":{"url":"https://api.github.com/repos/tflearn/tflearn/issues/comments/241085019","html_url":"https://github.com/tflearn/tflearn/issues/195#issuecomment-241085019","issue_url":"https://api.github.com/repos/tflearn/tflearn/issues/195","id":241085019,"user":{"login":"mbaniasad","id":1583083,"avatar_url":"https://avatars.githubusercontent.com/u/1583083?v=3","gravatar_id":"","url":"https://api.github.com/users/mbaniasad","html_url":"https://github.com/mbaniasad","followers_url":"https://api.github.com/users/mbaniasad/followers","following_url":"https://api.github.com/users/mbaniasad/following{/other_user}","gists_url":"https://api.github.com/users/mbaniasad/gists{/gist_id}","starred_url":"https://api.github.com/users/mbaniasad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbaniasad/subscriptions","organizations_url":"https://api.github.com/users/mbaniasad/orgs","repos_url":"https://api.github.com/users/mbaniasad/repos","events_url":"https://api.github.com/users/mbaniasad/events{/privacy}","received_events_url":"https://api.github.com/users/mbaniasad/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T17:42:21Z","updated_at":"2016-08-19T17:42:21Z","body":"I also got do work around it with the normal lstm sample that was in the tutorial but with dynamic  enabled I get this error\r\n```\r\nimport tensorflow as tf\r\nwith tf.Graph().as_default():\r\n    train, test, _ = imdb.load_data(path=dataset_path, n_words=10000,\r\n                                    valid_portion=0.1)\r\n    trainX, trainY = train\r\n    testX, testY = test\r\n\r\n    # Data preprocessing\r\n    # NOTE: Padding is required for dimension consistency. This will pad sequences\r\n    # with 0 at the end, until it reaches the max sequence length. 0 is used as a\r\n    # masking value by dynamic RNNs in TFLearn; a sequence length will be\r\n    # retrieved by counting non zero elements in a sequence. Then dynamic RNN step\r\n    # computation is performed according to that length.\r\n    trainX = pad_sequences(trainX, maxlen=100, value=0.)\r\n    testX = pad_sequences(testX, maxlen=100, value=0.)\r\n    # Converting labels to binary vectors\r\n    trainY = to_categorical(trainY, nb_classes=2)\r\n    testY = to_categorical(testY, nb_classes=2)\r\n\r\n    # Network building\r\n    net = tflearn.input_data([None, 100])\r\n    # Masking is not required for embedding, sequence length is computed prior to\r\n    # the embedding op and assigned as 'seq_length' attribute to the returned Tensor.\r\n    net = tflearn.embedding(net, input_dim=10000, output_dim=128)\r\n    net = tflearn.lstm(net, 128, dropout=0.8, dynamic=True)\r\n    net = tflearn.fully_connected(net, 2, activation='softmax')\r\n    net = tflearn.regression(net, optimizer='adam', learning_rate=0.001,\r\n                             loss='categorical_crossentropy')\r\n\r\n    # Training\r\n    model = tflearn.DNN(net, tensorboard_verbose=0, tensorboard_dir='./tflearn_logs/')\r\n    model.fit(trainX, trainY, validation_set=(testX, testY), show_metric=True,\r\n              batch_size=32, n_epoch=1)\r\n```"}}
{"actor":{"display_login":"mbaniasad"}}