{
  "id": 218432,
  "title": "Error when calling fit model in R",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/218432",
  "author_name": "Gayathri Nagarajan",
  "post_date": "2021-02-10T15:22:14.498000",
  "votes": 1,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi Team</p>\n<p>Iam doing the exact steps to fit my model for x ray images prediction similar to what is done in this <a href=\"https://www.kaggle.com/gayathrirprog/cassava-comp-keras-image-processing-conv-2d?scriptVersionId=52532625\" target=\"_blank\">notebook</a><br>\nAt the step of fitting model, Iam getting this error:</p>\n<p>Error in py_call_impl(callable, dots$args, dots$keywords): ValueError: Asked to retrieve element 0, but the Sequence has length 0</p>\n<p>Detailed traceback: <br>\n  File \"/usr/local/share/.virtualenvs/r-reticulate/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py\", line 324, in new_func</p>\n<p>Code snippet called :</p>\n<h1>fit model</h1>\n<p>history % fit_generator(<br>\n    train_generator,<br>\n    steps_per_epoch = round(nrow(y_train) / batch_size),<br>\n    epochs = nb_epochs,<br>\n   # callbacks = callback_list, #callback to update cylic lr<br>\n    callbacks = list(check_point, reduce_lr), <br>\n    validation_data = validation_generator,<br>\n    validation_step = round(nrow(y_valid) / batch_size)<br>\n)</p>\n<p>What could be the possible error ?</p>\n<p>Iam using the <a href=\"../input/vinbigdata-chest-xray-resized-png-1024x1024\" target=\"_blank\">data set</a></p>",
  "messages": [
    {
      "id": 1195133,
      "postDate": "2021-02-10T15:22:14.500Z",
      "content": "<p>Hi Team</p>\n<p>Iam doing the exact steps to fit my model for x ray images prediction similar to what is done in this <a href=\"https://www.kaggle.com/gayathrirprog/cassava-comp-keras-image-processing-conv-2d?scriptVersionId=52532625\" target=\"_blank\">notebook</a><br>\nAt the step of fitting model, Iam getting this error:</p>\n<p>Error in py_call_impl(callable, dots$args, dots$keywords): ValueError: Asked to retrieve element 0, but the Sequence has length 0</p>\n<p>Detailed traceback: <br>\n  File \"/usr/local/share/.virtualenvs/r-reticulate/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py\", line 324, in new_func</p>\n<p>Code snippet called :</p>\n<h1>fit model</h1>\n<p>history % fit_generator(<br>\n    train_generator,<br>\n    steps_per_epoch = round(nrow(y_train) / batch_size),<br>\n    epochs = nb_epochs,<br>\n   # callbacks = callback_list, #callback to update cylic lr<br>\n    callbacks = list(check_point, reduce_lr), <br>\n    validation_data = validation_generator,<br>\n    validation_step = round(nrow(y_valid) / batch_size)<br>\n)</p>\n<p>What could be the possible error ?</p>\n<p>Iam using the <a href=\"../input/vinbigdata-chest-xray-resized-png-1024x1024\" target=\"_blank\">data set</a></p>",
      "rawMarkdown": "Hi Team\n\nIam doing the exact steps to fit my model for x ray images prediction similar to what is done in this [notebook](https://www.kaggle.com/gayathrirprog/cassava-comp-keras-image-processing-conv-2d?scriptVersionId=52532625)\nAt the step of fitting model, Iam getting this error:\n\nError in py_call_impl(callable, dots$args, dots$keywords): ValueError: Asked to retrieve element 0, but the Sequence has length 0\n\nDetailed traceback: \n  File \"/usr/local/share/.virtualenvs/r-reticulate/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py\", line 324, in new_func\n\n\nCode snippet called :\n\n#fit model\nhistory <- model %>% fit_generator(\n    train_generator,\n    steps_per_epoch = round(nrow(y_train) / batch_size),\n    epochs = nb_epochs,\n   # callbacks = callback_list, #callback to update cylic lr\n    callbacks = list(check_point, reduce_lr), \n    validation_data = validation_generator,\n    validation_step = round(nrow(y_valid) / batch_size)\n)\n\n\nWhat could be the possible error ?\n\nIam using the [data set](../input/vinbigdata-chest-xray-resized-png-1024x1024)",
      "votes": 1
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1195133": "Hi Team\n\nIam doing the exact steps to fit my model for x ray images prediction similar to what is done in this [notebook](https://www.kaggle.com/gayathrirprog/cassava-comp-keras-image-processing-conv-2d?scriptVersionId=52532625)\nAt the step of fitting model, Iam getting this error:\n\nError in py_call_impl(callable, dots$args, dots$keywords): ValueError: Asked to retrieve element 0, but the Sequence has length 0\n\nDetailed traceback: \n  File \"/usr/local/share/.virtualenvs/r-reticulate/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py\", line 324, in new_func\n\n\nCode snippet called :\n\n#fit model\nhistory <- model %>% fit_generator(\n    train_generator,\n    steps_per_epoch = round(nrow(y_train) / batch_size),\n    epochs = nb_epochs,\n   # callbacks = callback_list, #callback to update cylic lr\n    callbacks = list(check_point, reduce_lr), \n    validation_data = validation_generator,\n    validation_step = round(nrow(y_valid) / batch_size)\n)\n\n\nWhat could be the possible error ?\n\nIam using the [data set](../input/vinbigdata-chest-xray-resized-png-1024x1024)"
  }
}