{
  "id": 76149,
  "title": "Tokenizer not working ",
  "url": "/competitions/quora-insincere-questions-classification/discussion/76149",
  "author_name": "",
  "post_date": "2018-12-29T19:28:30.676233900Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I am having trouble in tokenizing the test.</p>\n\n<p><strong>Below is the code snippet that i am trying to use to tokenize  the text.</strong> </p>\n\n<p>*tokenizer = Tokenizer(num_words=50000)\ntokenizer.fit_on_texts(list(train_X))*</p>\n\n<p>I am getting the  following error. it was working fine earlier but i am not sure why it is not working.  I tried using both GPU on and off as i suspect the keras version might be different.</p>\n\n<p>TypeError: <strong>init</strong>() got an unexpected keyword argument 'num_words'</p>",
  "messages": [
    {
      "id": "447415",
      "postDate": "12/29/2018 19:28:30",
      "content": "<p>I am having trouble in tokenizing the test.</p>\n\n<p><strong>Below is the code snippet that i am trying to use to tokenize  the text.</strong> </p>\n\n<p>*tokenizer = Tokenizer(num_words=50000)\ntokenizer.fit_on_texts(list(train_X))*</p>\n\n<p>I am getting the  following error. it was working fine earlier but i am not sure why it is not working.  I tried using both GPU on and off as i suspect the keras version might be different.</p>\n\n<p>TypeError: <strong>init</strong>() got an unexpected keyword argument 'num_words'</p>",
      "rawMarkdown": "I am having trouble in tokenizing the test.\n\n**Below is the code snippet that i am trying to use to tokenize  the text.** \n\n*tokenizer = Tokenizer(num_words=50000)\ntokenizer.fit_on_texts(list(train_X))*\n\nI am getting the  following error. it was working fine earlier but i am not sure why it is not working.  I tried using both GPU on and off as i suspect the keras version might be different.\n\n\nTypeError: __init__() got an unexpected keyword argument 'num_words'",
      "votes": null
    },
    {
      "id": "447418",
      "postDate": "12/29/2018 19:31:52",
      "content": "<p>here is the complete error log that i am getting</p>\n\n<p>TypeError: <strong>init</strong>() got an unexpected keyword argument 'num_words'</p>",
      "rawMarkdown": "here is the complete error log that i am getting\n\nTypeError: __init__() got an unexpected keyword argument 'num_words'",
      "votes": null
    },
    {
      "id": "447830",
      "postDate": "12/30/2018 17:02:26",
      "content": "<p>did you use this import only:</p>\n\n<p>from keras.preprocessing.text import Tokenizer</p>",
      "rawMarkdown": "did you use this import only:\n\nfrom keras.preprocessing.text import Tokenizer",
      "votes": null
    },
    {
      "id": "447845",
      "postDate": "12/30/2018 18:03:30",
      "content": "<p>I have used the same way  as you have mentioned to import the Tokenizer from Keras</p>",
      "rawMarkdown": "I have used the same way  as you have mentioned to import the Tokenizer from Keras",
      "votes": null
    },
    {
      "id": "447866",
      "postDate": "12/30/2018 18:22:08",
      "content": "<p>Thanks for your help. Reinstalling tensorflow and keras solved the issue.</p>",
      "rawMarkdown": "Thanks for your help. Reinstalling tensorflow and keras solved the issue.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 447418,
      "author_name": "nav20dec",
      "author_url": "",
      "post_date": "12/29/2018 19:31:52",
      "content": "<p>here is the complete error log that i am getting</p>\n\n<p>TypeError: <strong>init</strong>() got an unexpected keyword argument 'num_words'</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 447830,
      "author_name": "mlwhiz",
      "author_url": "",
      "post_date": "12/30/2018 17:02:26",
      "content": "<p>did you use this import only:</p>\n\n<p>from keras.preprocessing.text import Tokenizer</p>",
      "votes": null,
      "replies": [
        {
          "id": 447845,
          "author_name": "nav20dec",
          "author_url": "",
          "post_date": "12/30/2018 18:03:30",
          "content": "<p>I have used the same way  as you have mentioned to import the Tokenizer from Keras</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 447866,
          "author_name": "nav20dec",
          "author_url": "",
          "post_date": "12/30/2018 18:22:08",
          "content": "<p>Thanks for your help. Reinstalling tensorflow and keras solved the issue.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "447415": "I am having trouble in tokenizing the test.\n\n**Below is the code snippet that i am trying to use to tokenize  the text.** \n\n*tokenizer = Tokenizer(num_words=50000)\ntokenizer.fit_on_texts(list(train_X))*\n\nI am getting the  following error. it was working fine earlier but i am not sure why it is not working.  I tried using both GPU on and off as i suspect the keras version might be different.\n\n\nTypeError: __init__() got an unexpected keyword argument 'num_words'",
    "447418": "here is the complete error log that i am getting\n\nTypeError: __init__() got an unexpected keyword argument 'num_words'",
    "447830": "did you use this import only:\n\nfrom keras.preprocessing.text import Tokenizer",
    "447845": "I have used the same way  as you have mentioned to import the Tokenizer from Keras",
    "447866": "Thanks for your help. Reinstalling tensorflow and keras solved the issue."
  },
  "source": "meta"
}