{
  "id": 21035,
  "title": "data not defined",
  "url": "/competitions/digit-recognizer/discussion/21035",
  "author_name": "MichaelLanier",
  "post_date": "2016-05-18T03:20:51.877000",
  "votes": 0,
  "comment_count": 0,
  "views": null,
  "content": "<p>Hello all,</p>\n\n<p>I am more of an R person myself. I am trying to run a NN through keras. I was wondering if anyone can tell me why my script has this error. I believe this is a standard code from many scripts:</p>\n\n<pre><code>train = pd.read_csv(&quot;train.csv&quot;).values\ntest  = pd.read_csv(&quot;test.csv&quot;).values\n\n\ntrainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\ntrainX = trainX.astype(float)\ntrainX /= 255.0\n</code></pre>\n\n<p>The console reads:</p>\n\n<pre><code>&gt;&gt;&gt; nb_epoch = 1 #12\n&gt;&gt;&gt; nb_filters = 32\n&gt;&gt;&gt; nb_pool = 2\n&gt;&gt;&gt; nb_conv = 3\n&gt;&gt;&gt; img_rows, img_cols = 28, 28\n&gt;&gt;&gt; \n&gt;&gt;&gt; train = pd.read_csv(&quot;train.csv&quot;).values\n&gt;&gt;&gt; test  = pd.read_csv(&quot;test.csv&quot;).values\n&gt;&gt;&gt; \n&gt;&gt;&gt; \n&gt;&gt;&gt; trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\nTraceback (most recent call last):\n  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;\nValueError: total size of new array must be unchanged\n</code></pre>",
  "messages": [
    {
      "id": 120419,
      "postDate": "2016-05-18T03:20:51.877Z",
      "content": "<p>Hello all,</p>\n\n<p>I am more of an R person myself. I am trying to run a NN through keras. I was wondering if anyone can tell me why my script has this error. I believe this is a standard code from many scripts:</p>\n\n<pre><code>train = pd.read_csv(&quot;train.csv&quot;).values\ntest  = pd.read_csv(&quot;test.csv&quot;).values\n\n\ntrainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\ntrainX = trainX.astype(float)\ntrainX /= 255.0\n</code></pre>\n\n<p>The console reads:</p>\n\n<pre><code>&gt;&gt;&gt; nb_epoch = 1 #12\n&gt;&gt;&gt; nb_filters = 32\n&gt;&gt;&gt; nb_pool = 2\n&gt;&gt;&gt; nb_conv = 3\n&gt;&gt;&gt; img_rows, img_cols = 28, 28\n&gt;&gt;&gt; \n&gt;&gt;&gt; train = pd.read_csv(&quot;train.csv&quot;).values\n&gt;&gt;&gt; test  = pd.read_csv(&quot;test.csv&quot;).values\n&gt;&gt;&gt; \n&gt;&gt;&gt; \n&gt;&gt;&gt; trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\nTraceback (most recent call last):\n  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;\nValueError: total size of new array must be unchanged\n</code></pre>",
      "rawMarkdown": "Hello all,\r\n\r\nI am more of an R person myself. I am trying to run a NN through keras. I was wondering if anyone can tell me why my script has this error. I believe this is a standard code from many scripts:\r\n\r\n    train = pd.read_csv(\"train.csv\").values\r\n    test  = pd.read_csv(\"test.csv\").values\r\n    \r\n    \r\n    trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\r\n    trainX = trainX.astype(float)\r\n    trainX /= 255.0\r\n\r\n\r\nThe console reads:\r\n\r\n    >>> nb_epoch = 1 #12\r\n    >>> nb_filters = 32\r\n    >>> nb_pool = 2\r\n    >>> nb_conv = 3\r\n    >>> img_rows, img_cols = 28, 28\r\n    >>> \r\n    >>> train = pd.read_csv(\"train.csv\").values\r\n    >>> test  = pd.read_csv(\"test.csv\").values\r\n    >>> \r\n    >>> \r\n    >>> trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n    ValueError: total size of new array must be unchanged"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "120419": "Hello all,\r\n\r\nI am more of an R person myself. I am trying to run a NN through keras. I was wondering if anyone can tell me why my script has this error. I believe this is a standard code from many scripts:\r\n\r\n    train = pd.read_csv(\"train.csv\").values\r\n    test  = pd.read_csv(\"test.csv\").values\r\n    \r\n    \r\n    trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\r\n    trainX = trainX.astype(float)\r\n    trainX /= 255.0\r\n\r\n\r\nThe console reads:\r\n\r\n    >>> nb_epoch = 1 #12\r\n    >>> nb_filters = 32\r\n    >>> nb_pool = 2\r\n    >>> nb_conv = 3\r\n    >>> img_rows, img_cols = 28, 28\r\n    >>> \r\n    >>> train = pd.read_csv(\"train.csv\").values\r\n    >>> test  = pd.read_csv(\"test.csv\").values\r\n    >>> \r\n    >>> \r\n    >>> trainX = train[:, 1:].reshape(train.shape[0], 1, img_rows, img_cols)\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n    ValueError: total size of new array must be unchanged"
  }
}