{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/keras/issues/586","repository_url":"https://api.github.com/repos/rstudio/keras","labels_url":"https://api.github.com/repos/rstudio/keras/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/keras/issues/586/comments","events_url":"https://api.github.com/repos/rstudio/keras/issues/586/events","html_url":"https://github.com/rstudio/keras/issues/586","id":376947563,"node_id":"MDU6SXNzdWUzNzY5NDc1NjM=","number":586,"title":"Allaire Audio Classification Error","user":{"login":"bmitre","id":44672648,"node_id":"MDQ6VXNlcjQ0NjcyNjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/44672648?v=4","gravatar_id":"","url":"https://api.github.com/users/bmitre","html_url":"https://github.com/bmitre","followers_url":"https://api.github.com/users/bmitre/followers","following_url":"https://api.github.com/users/bmitre/following{/other_user}","gists_url":"https://api.github.com/users/bmitre/gists{/gist_id}","starred_url":"https://api.github.com/users/bmitre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmitre/subscriptions","organizations_url":"https://api.github.com/users/bmitre/orgs","repos_url":"https://api.github.com/users/bmitre/repos","events_url":"https://api.github.com/users/bmitre/events{/privacy}","received_events_url":"https://api.github.com/users/bmitre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-11-02T19:55:42Z","updated_at":"2018-11-12T23:06:46Z","closed_at":null,"author_association":"NONE","body":"## I have an error when trying to run the following code (see very bottom) from Allaire's Github page. I would appreciate all the help I can get. Thank you.\r\n\r\n## After downloading the speech commands, I first run the following:\r\n\r\nhttps://github.com/jjallaire/optimizing-audio-classification/blob/master/util/splits.R\r\n\r\n## I then run the following:\r\n\r\nhttps://github.com/jjallaire/optimizing-audio-classification/blob/master/train.R\r\n\r\n## The first error I get is after sess$run(tf$tables_initializerI()). See the following:\r\nsess$run(tf$tables_initializer())\r\n2018-11-03 11:06:41.031782: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\n2018-11-03 11:06:41.031788: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\n2018-11-03 11:06:41.031895: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\n2018-11-03 11:06:41.031782: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\n2018-11-03 11:06:41.032185: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\n2018-11-03 11:06:41.032452: W T:\\src\\github\\tensorflow\\tensorflow\\core\\framework\\op_kernel.cc:1275] OP_REQUIRES failed at lookup_table_init_op.cc:83 : Failed precondition: Table already initialized.\r\nError in py_call_impl(callable, dots$args, dots$keywords) : \r\n  FailedPreconditionError: Table already initialized.\r\n\t [[Node: string_to_index/hash_table/table_init = InitializeTableV2[Tkey=DT_STRING, Tval=DT_INT64, _device=\"/job:localhost/replica:0/task:0/device:CPU:0\"](string_to_index/hash_table, Const, string_to_index/ToInt64)]]\r\n\r\nCaused by op 'string_to_index/hash_table/table_init', defined at:\r\n  File \"C:\\Users\\bgaucher\\AppData\\Local\\CONTIN~1\\ANACON~1\\envs\\R-TENS~1\\lib\\site-packages\\tensorflow\\contrib\\lookup\\lookup_ops.py\", line 138, in index_table_from_tensor\r\n    name=name)\r\n  File \"C:\\Users\\bgaucher\\AppData\\Local\\CONTIN~1\\ANACON~1\\envs\\R-TENS~1\\lib\\site-packages\\tensorflow\\python\\ops\\lookup_ops.py\", line 1127, in index_table_from_tensor\r\n    init, default_value, shared_name=shared_name, name=hash_table_scope)\r\n  File \"C:\\Users\\bgaucher\\AppData\\Local\\CONTIN~1\\ANACON~1\\envs\\R-TENS~1\\lib\\site-packages\\tensorflow\\python\\ops\\lookup_ops.py\", line 279, in __init__\r\n    super(HashTable, self).__init__(table_ref, default_value, initializer)\r\n  File**\r\n\r\n\r\n## The final error I get is after model %>% fit(). See the following:\r\n\r\nmodel %>% fit(\r\n+   \r\n+   ds_train,\r\n+   \r\n+   steps_per_epoch = 1000,\r\n+   \r\n+   epochs = 10, \r\n+   \r\n+   validation_data = ds_test, \r\n+   \r\n+   validation_steps = 1000\r\n+   \r\n+ )\r\nError in py_call_impl(callable, dots$args, dots$keywords) : \r\n  ValueError: Failed to create a one-shot iterator for a dataset. `Dataset.make_one_shot_iterator()` does not support datasets that capture stateful objects, such as a `Variable` or `LookupTable`. In these cases, use `Dataset.make_initializable_iterator()`. (Original error: Cannot capture a stateful node (name:string_to_index_6/hash_table, type:HashTableV2) by value.)\r\n\r\nDetailed traceback: \r\n  File \"C:\\Users\\bgaucher\\AppData\\Local\\CONTIN~1\\ANACON~1\\envs\\R-TENS~1\\lib\\site-packages\\tensorflow\\python\\data\\ops\\dataset_ops.py\", line 168, in make_one_shot_iterator\r\n    \"(Original error: %s)\" % err)**\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/keras/issues/comments/438061769","html_url":"https://github.com/rstudio/keras/issues/586#issuecomment-438061769","issue_url":"https://api.github.com/repos/rstudio/keras/issues/586","id":438061769,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODA2MTc2OQ==","user":{"login":"bmitre","id":44672648,"node_id":"MDQ6VXNlcjQ0NjcyNjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/44672648?v=4","gravatar_id":"","url":"https://api.github.com/users/bmitre","html_url":"https://github.com/bmitre","followers_url":"https://api.github.com/users/bmitre/followers","following_url":"https://api.github.com/users/bmitre/following{/other_user}","gists_url":"https://api.github.com/users/bmitre/gists{/gist_id}","starred_url":"https://api.github.com/users/bmitre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmitre/subscriptions","organizations_url":"https://api.github.com/users/bmitre/orgs","repos_url":"https://api.github.com/users/bmitre/repos","events_url":"https://api.github.com/users/bmitre/events{/privacy}","received_events_url":"https://api.github.com/users/bmitre/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T23:06:46Z","updated_at":"2018-11-12T23:06:46Z","author_association":"NONE","body":"Hello,\r\n\r\nDid anybody get the following warning messages (below) and does anybody have any ideas?\r\n\r\n> model %>% fit_generator(\r\n+     generator = ds_train,\r\n+     steps_per_epoch = 0.7*nrow(df)/32,\r\n+     epochs = 10, \r\n+     validation_data = ds_validation, \r\n+     validation_steps = 0.3*nrow(df)/32,\r\n+     callbacks = list(callback_model_checkpoint(\"weights.{epoch:02d}-{val_loss:.2f}.hdf5\"))\r\n+ )\r\nEpoch 1/10\r\n1415/1415 [==============================] - 9372s 7s/step - loss: 2.1226 - acc: 0.3937 - val_loss: 0.9519 - val_acc: 0.7343\r\nEpoch 2/10\r\n1415/1415 [==============================] - 2692s 2s/step - loss: 1.2086 - acc: 0.6556 - val_loss: 0.6414 - val_acc: 0.8240\r\nEpoch 3/10\r\n1415/1415 [==============================] - 2636s 2s/step - loss: 1.0060 - acc: 0.7188 - val_loss: 0.6007 - val_acc: 0.8296\r\nEpoch 4/10\r\n1415/1415 [==============================] - 2928s 2s/step - loss: 0.9280 - acc: 0.7445 - val_loss: 0.7207 - val_acc: 0.8006\r\nEpoch 5/10\r\n1415/1415 [==============================] - 3326s 2s/step - loss: 0.9370 - acc: 0.7517 - val_loss: 0.5714 - val_acc: 0.8378\r\nEpoch 6/10\r\n1415/1415 [==============================] - 2728s 2s/step - loss: 0.9663 - acc: 0.7557 - val_loss: 0.7223 - val_acc: 0.8113\r\nEpoch 7/10\r\n1415/1415 [==============================] - 2633s 2s/step - loss: 1.0237 - acc: 0.7475 - val_loss: 0.6032 - val_acc: 0.8545\r\nEpoch 8/10\r\n1415/1415 [==============================] - 2520s 2s/step - loss: 1.0544 - acc: 0.7475 - val_loss: 0.5706 - val_acc: 0.8574\r\nEpoch 9/10\r\n1415/1415 [==============================] - 2404s 2s/step - loss: 1.0760 - acc: 0.7456 - val_loss: 0.6722 - val_acc: 0.8314\r\nEpoch 10/10\r\n1415/1415 [==============================] - 2453s 2s/step - loss: 1.1110 - acc: 0.7408 - val_loss: 0.6334 - val_acc: 0.8477\r\nWarning messages:\r\n1: In normalizePath(path.expand(path), winslash, mustWork) :\r\n  path[1]=\"\": The filename, directory name, or volume label syntax is incorrect\r\n2: In normalizePath(path.expand(path), winslash, mustWork) :\r\n  path[1]=\"\": The filename, directory name, or volume label syntax is incorrect\r\n> \r\n> \r\n> \r\n> \r\n> df_validation <- df[-id_train,]\r\n> n_steps <- nrow(df_validation)/32 + 1\r\n> \r\n> predictions <- predict_generator(\r\n+     model, \r\n+     ds_validation, \r\n+     steps = n_steps\r\n+ )\r\nWarning message:\r\nIn normalizePath(path.expand(path), winslash, mustWork) :\r\n  path[1]=\"\": The filename, directory name, or volume label syntax is incorrect\r\n"}}
{"actor":{"display_login":"bmitre"}}