{
  "id": 73421,
  "title": "14 GB RAM and 2 hours  is  limited for Tensorflow users",
  "url": "/competitions/quora-insincere-questions-classification/discussion/73421",
  "author_name": "aintnosunshine",
  "post_date": "2018-12-03T03:09:05.791000",
  "votes": 3,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Those who are using Keras might be okay with this, but tensorflow users find it hard. By loading 2 embedding models, it consumes a lot of memory. Then, we need to create the training embedding out of it, then preprocess the text etc. \nThe main problem, is CUdNNgru / lstm is not reliable. For a tensorflow, bidirectional lstm, it takes more than 8000 seconds, which leads to time out. Because, it is not using CUdNNgru/lstm internally. Because,  CUdNNgru/lstm has lot of issues like randomness, not able to deal with varying length sequences etc. So, thinking about ensembling is beyond the scope. Am i forced to use Keras?</p>",
  "messages": [
    {
      "id": 431863,
      "postDate": "2018-12-03T03:09:05.793Z",
      "content": "<p>Those who are using Keras might be okay with this, but tensorflow users find it hard. By loading 2 embedding models, it consumes a lot of memory. Then, we need to create the training embedding out of it, then preprocess the text etc. \nThe main problem, is CUdNNgru / lstm is not reliable. For a tensorflow, bidirectional lstm, it takes more than 8000 seconds, which leads to time out. Because, it is not using CUdNNgru/lstm internally. Because,  CUdNNgru/lstm has lot of issues like randomness, not able to deal with varying length sequences etc. So, thinking about ensembling is beyond the scope. Am i forced to use Keras?</p>",
      "rawMarkdown": "Those who are using Keras might be okay with this, but tensorflow users find it hard. By loading 2 embedding models, it consumes a lot of memory. Then, we need to create the training embedding out of it, then preprocess the text etc. \nThe main problem, is CUdNNgru / lstm is not reliable. For a tensorflow, bidirectional lstm, it takes more than 8000 seconds, which leads to time out. Because, it is not using CUdNNgru/lstm internally. Because,  CUdNNgru/lstm has lot of issues like randomness, not able to deal with varying length sequences etc. So, thinking about ensembling is beyond the scope. Am i forced to use Keras?",
      "votes": 3
    },
    {
      "id": 433352,
      "postDate": "2018-12-05T01:52:04.257Z",
      "content": "<p>There shouldn't be any difference between Keras and TF since Keras is just a high-level wrapper for TF. I don't think there is a difference of speed between TF and Keras in terms of embedding and pre-processing.</p>\n\n<p>TF also has  <a href=\"https://www.tensorflow.org/api_docs/python/tf/contrib/cudnn_rnn/CudnnLSTM\">CudnnLSTM/CudnnGRU</a>. Tensorflow's <a href=\"https://www.tensorflow.org/api_docs/python/tf/nn/rnn_cell/LSTMCell\">native implementation</a> of LSTM IS actually stable and reproducible.  CuDnnLSTM is the one that is not reproducible.</p>",
      "rawMarkdown": "There shouldn't be any difference between Keras and TF since Keras is just a high-level wrapper for TF. I don't think there is a difference of speed between TF and Keras in terms of embedding and pre-processing.\n\nTF also has  [CudnnLSTM/CudnnGRU](https://www.tensorflow.org/api_docs/python/tf/contrib/cudnn_rnn/CudnnLSTM). Tensorflow's [native implementation](https://www.tensorflow.org/api_docs/python/tf/nn/rnn_cell/LSTMCell) of LSTM IS actually stable and reproducible.  CuDnnLSTM is the one that is not reproducible.",
      "votes": 1,
      "replies": [
        {
          "id": 434448,
          "postDate": "2018-12-06T12:19:42.483Z",
          "content": "<p>All keras code here uses CuDNNLSTM. Tensorflow have this, but it wont support variable size sentences.</p>",
          "rawMarkdown": "All keras code here uses CuDNNLSTM. Tensorflow have this, but it wont support variable size sentences."
        }
      ]
    },
    {
      "id": 432086,
      "postDate": "2018-12-03T11:41:23.047Z",
      "content": "<p>Could CudNNLSTM in Keras deal with varying length sequences? </p>",
      "rawMarkdown": "Could CudNNLSTM in Keras deal with varying length sequences? ",
      "replies": [
        {
          "id": 432212,
          "postDate": "2018-12-03T15:03:06.303Z",
          "content": "<p>AFAIK it should be fine if you just set the input shape to <code>None</code> for the sequence length</p>",
          "rawMarkdown": "AFAIK it should be fine if you just set the input shape to `None` for the sequence length"
        },
        {
          "id": 432263,
          "postDate": "2018-12-03T16:26:58.953Z",
          "content": "<p>it won't help. AFAIK, it won't deal with varying length sequences</p>",
          "rawMarkdown": "it won't help. AFAIK, it won't deal with varying length sequences"
        },
        {
          "id": 432408,
          "postDate": "2018-12-03T20:19:51.490Z",
          "content": "<p>Sure it works, but you can't mask zeros.</p>",
          "rawMarkdown": "Sure it works, but you can't mask zeros."
        },
        {
          "id": 432561,
          "postDate": "2018-12-04T03:31:48.933Z",
          "content": "<p>How? In the tensorflow API, I have not seen a parameter to provide, sentence lengths explicitly. </p>\n\n<p><code>\n__init__(\n    num_layers,\n    num_units,\n    input_mode=CUDNN_INPUT_LINEAR_MODE,\n    direction=CUDNN_RNN_UNIDIRECTION,\n    dropout=0.0,\n    seed=None,\n    dtype=tf.float32,\n    kernel_initializer=None,\n    bias_initializer=None,\n    name=None\n)\n</code></p>",
          "rawMarkdown": "How? In the tensorflow API, I have not seen a parameter to provide, sentence lengths explicitly. \n\n```\n__init__(\n    num_layers,\n    num_units,\n    input_mode=CUDNN_INPUT_LINEAR_MODE,\n    direction=CUDNN_RNN_UNIDIRECTION,\n    dropout=0.0,\n    seed=None,\n    dtype=tf.float32,\n    kernel_initializer=None,\n    bias_initializer=None,\n    name=None\n)\n```"
        }
      ]
    },
    {
      "id": 432226,
      "postDate": "2018-12-03T15:23:24.040Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 433352,
      "author_name": "sijunhe",
      "author_url": "",
      "post_date": "2018-12-05T01:52:04.257000",
      "content": "<p>There shouldn't be any difference between Keras and TF since Keras is just a high-level wrapper for TF. I don't think there is a difference of speed between TF and Keras in terms of embedding and pre-processing.</p>\n\n<p>TF also has  <a href=\"https://www.tensorflow.org/api_docs/python/tf/contrib/cudnn_rnn/CudnnLSTM\">CudnnLSTM/CudnnGRU</a>. Tensorflow's <a href=\"https://www.tensorflow.org/api_docs/python/tf/nn/rnn_cell/LSTMCell\">native implementation</a> of LSTM IS actually stable and reproducible.  CuDnnLSTM is the one that is not reproducible.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 434448,
          "author_name": "aintnosunshine",
          "author_url": "",
          "post_date": "2018-12-06T12:19:42.483000",
          "content": "<p>All keras code here uses CuDNNLSTM. Tensorflow have this, but it wont support variable size sentences.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 432086,
      "author_name": "Lancelot0",
      "author_url": "",
      "post_date": "2018-12-03T11:41:23.047000",
      "content": "<p>Could CudNNLSTM in Keras deal with varying length sequences? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 432212,
          "author_name": "Max Schumacher",
          "author_url": "",
          "post_date": "2018-12-03T15:03:06.303000",
          "content": "<p>AFAIK it should be fine if you just set the input shape to <code>None</code> for the sequence length</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 432263,
          "author_name": "aintnosunshine",
          "author_url": "",
          "post_date": "2018-12-03T16:26:58.953000",
          "content": "<p>it won't help. AFAIK, it won't deal with varying length sequences</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 432408,
          "author_name": "Psi",
          "author_url": "",
          "post_date": "2018-12-03T20:19:51.490000",
          "content": "<p>Sure it works, but you can't mask zeros.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 432561,
          "author_name": "aintnosunshine",
          "author_url": "",
          "post_date": "2018-12-04T03:31:48.933000",
          "content": "<p>How? In the tensorflow API, I have not seen a parameter to provide, sentence lengths explicitly. </p>\n\n<p><code>\n__init__(\n    num_layers,\n    num_units,\n    input_mode=CUDNN_INPUT_LINEAR_MODE,\n    direction=CUDNN_RNN_UNIDIRECTION,\n    dropout=0.0,\n    seed=None,\n    dtype=tf.float32,\n    kernel_initializer=None,\n    bias_initializer=None,\n    name=None\n)\n</code></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 432226,
      "author_name": "",
      "author_url": "",
      "post_date": "2018-12-03T15:23:24.040000",
      "content": "",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "431863": "Those who are using Keras might be okay with this, but tensorflow users find it hard. By loading 2 embedding models, it consumes a lot of memory. Then, we need to create the training embedding out of it, then preprocess the text etc. \nThe main problem, is CUdNNgru / lstm is not reliable. For a tensorflow, bidirectional lstm, it takes more than 8000 seconds, which leads to time out. Because, it is not using CUdNNgru/lstm internally. Because,  CUdNNgru/lstm has lot of issues like randomness, not able to deal with varying length sequences etc. So, thinking about ensembling is beyond the scope. Am i forced to use Keras?",
    "433352": "There shouldn't be any difference between Keras and TF since Keras is just a high-level wrapper for TF. I don't think there is a difference of speed between TF and Keras in terms of embedding and pre-processing.\n\nTF also has  [CudnnLSTM/CudnnGRU](https://www.tensorflow.org/api_docs/python/tf/contrib/cudnn_rnn/CudnnLSTM). Tensorflow's [native implementation](https://www.tensorflow.org/api_docs/python/tf/nn/rnn_cell/LSTMCell) of LSTM IS actually stable and reproducible.  CuDnnLSTM is the one that is not reproducible.",
    "432086": "Could CudNNLSTM in Keras deal with varying length sequences? ",
    "432226": ""
  }
}