{
  "id": 12750,
  "title": "Code sample for score of 0.93",
  "url": "/competitions/datasciencebowl/discussion/12750",
  "author_name": "",
  "post_date": "2015-03-09T23:04:09.050Z",
  "votes": 6,
  "comment_count": 35,
  "views": 8980,
  "content": "<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>",
  "messages": [
    {
      "id": "65818",
      "postDate": "03/09/2015 23:04:09",
      "content": "<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65827",
      "postDate": "03/10/2015 00:52:45",
      "content": "<p>It looks like both your train and validation sets are augmented, thus your overfit. If you split the data before augmentation and then only augment the train, I think your validation score will be much closer to your leaderboard score.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65828",
      "postDate": "03/10/2015 01:15:13",
      "content": "<p>James,</p>\n<p>Good catch! I didn't see that. I moved the train/validation step to before the augmentation step and I get a validation score of 0.95 which is comparable to the leaderboard score.&nbsp;</p>\n<p>I will update the github code.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65846",
      "postDate": "03/10/2015 02:47:29",
      "content": "<p>is this code mean u set color channel to 3&nbsp;?</p>\n<p>input_shape = 3,48,48</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65847",
      "postDate": "03/10/2015 02:48:34",
      "content": "<p>I don't think that should matter. I can confirm and let you know.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65848",
      "postDate": "03/10/2015 02:50:06",
      "content": "<p>What's your train set and validation set ratio?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65849",
      "postDate": "03/10/2015 02:51:21",
      "content": "<p>I set it to 95-5% and maintained the class ratio to be the same in both sets.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65850",
      "postDate": "03/10/2015 02:54:47",
      "content": "<p>OK, as our team's&nbsp;experience, that's very unstable. If you split another 95%-5% set and use the same model same setting, the result will change a lot.</p>\n<p>I think 75%-25% would be stable.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65854",
      "postDate": "03/10/2015 03:37:09",
      "content": "<p>hi Liang Pang</p>\n<p>are you using similar network architecture like&nbsp;Srikrishna ? You don't have to give any deep details. just general info like is it more deeper</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65858",
      "postDate": "03/10/2015 04:36:18",
      "content": "<p>This worked for me. Took a bit over an hour with gtx 750. Make sure you have the sample submission in the same directory as the python script or it will fail to make submission.csv.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65859",
      "postDate": "03/10/2015 04:39:31",
      "content": "<p>I am glad this worked. Most of time is spent in averaging a prediction from random crops.</p>\n<p>I will add the submission.csv requirement to the README.md. That was only required because the submission required the columns to be sorted in an odd way.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65860",
      "postDate": "03/10/2015 04:43:07",
      "content": "<p>@Data-Lover Yeah, my model is deeper than Srikrishna.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65861",
      "postDate": "03/10/2015 04:56:50",
      "content": "<p>[quote=Srikrishna Sridhar;65859]</p>\n<p>I am glad this worked. Most of time is spent in averaging a prediction from random crops.</p>\n<p>I will add the submission.csv requirement to the README.md. That was only required because the submission required the columns to be sorted in an odd way.</p>\n<p>[/quote]</p>\n\n<p>the columns can be in any order actually.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65863",
      "postDate": "03/10/2015 05:41:40",
      "content": "<p>This code runs on &quot;GraphLab-Create&quot;, which is neither free, nor open-source. Results you get from it are ineligible in this competition.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65864",
      "postDate": "03/10/2015 06:19:28",
      "content": "<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65876",
      "postDate": "03/10/2015 13:24:16",
      "content": "<p>[quote=Srikrishna Sridhar;65864]</p>\n<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>\n<p>[/quote]</p>\n<p>Thank you for your contribution. Any clue for the following problem? </p>\n<p>import graphlab as gl<br>Traceback (most recent call last):</p>\n<p>File &quot;&lt;ipython-input-1-4a710214f762&gt;&quot;, line 1, in &lt;module&gt;<br> import graphlab as gl</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/__init__.py&quot;, line 37, in &lt;module&gt;<br> import graphlab.deploy</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/__init__.py&quot;, line 26, in &lt;module&gt;<br> _default_session = _session._open()</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 532, in _open<br> return Session(location)</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 111, in __init__<br> self._lock = _lockfile.LockFile(_os.path.join(self.location, 'lock'))</p>\n<p>AttributeError: 'module' object has no attribute 'LockFile'</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65885",
      "postDate": "03/10/2015 14:53:39",
      "content": "<p>Thanks for the guide. I am trying to understand the data augmentation you use: you resize first to 64x64, then do 90,180,270 deg. rotations which gives you four times as many images. Then you do random crops to 48x48 and also random mirroring. How many random crops and mirroring operations do you do? How many images you create through your data augmentation for each training image?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65889",
      "postDate": "03/10/2015 16:15:57",
      "content": "<p>@nils Each time the image is seen during training, random crop of size 48x48 is taken. The same for predict time (which is why I average predictions). Hence, I only have 4 rotated copies of the image i.e fixed size rotations. I am not experimenting with other augmentation techniques that were discussed in another forum post.</p>\n\n<p>@Rafeal I don't use anaconda and it seems like that might be an issue. It could be a conflict of lockfile packages 0.9 vs 0.10. Try installing lockfile 0.9 instead of 0.10. (Just a guess)</p>\n<p>I filed an issue&nbsp;https://github.com/srikris/datascience-bowl/issues/1 near the source so if you figure out how to get it work or have more discussions, I can help here.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65893",
      "postDate": "03/10/2015 17:02:47",
      "content": "<p>[quote=Rafael;65876]</p>\n<p>[quote=Srikrishna Sridhar;65864]</p>\n<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>\n<p>[/quote]</p>\n<p>Thank you for your contribution. Any clue for the following problem?</p>\n<p>import graphlab as gl<br>Traceback (most recent call last):</p>\n<p>File &quot;&lt;ipython-input-1-4a710214f762&gt;&quot;, line 1, in &lt;module&gt;<br> import graphlab as gl</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/__init__.py&quot;, line 37, in &lt;module&gt;<br> import graphlab.deploy</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/__init__.py&quot;, line 26, in &lt;module&gt;<br> _default_session = _session._open()</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 532, in _open<br> return Session(location)</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 111, in __init__<br> self._lock = _lockfile.LockFile(_os.path.join(self.location, 'lock'))</p>\n<p>AttributeError: 'module' object has no attribute 'LockFile'</p>\n<p>[/quote]</p>\n\n<p>When I searched for a solution, I stumbled&nbsp;up on the discussion&nbsp;<a href=\"https://bugs.launchpad.net/pylockfile/+bug/1422238\">here</a>. It seems that in lockfile 0.10.2, &nbsp;lockfile.FileLock is available. So a dirty fix would be to use FileLock in place of LockFile. &nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65894",
      "postDate": "03/10/2015 17:12:33",
      "content": "<p>[quote=SRK;65893]</p>\n<p>When I searched for a solution, I stumbled&nbsp;up on the discussion&nbsp;<a href=\"https://bugs.launchpad.net/pylockfile/+bug/1422238\">here</a>. It seems that in lockfile 0.10.2, &nbsp;lockfile.FileLock is available. So a dirty fix would be to use FileLock in place of LockFile. &nbsp;</p>\n<p>[/quote]</p>\n<p>Yeah, it fixes! thank you!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65895",
      "postDate": "03/10/2015 17:31:44",
      "content": "<p>Is any missed in network.conf ? I run into the following error.</p>\n<p>jkao@debian:~/Media/datascience-bowl$ python make_submission.py <br>Loading images...<br>[INFO] Start server at: ipc:///tmp/graphlab_server-6138 - Server binary: /home/jkao/anaconda/lib/python2.7/site-packages/graphlab/unity_server - Server log: /tmp/graphlab_server_1426008465.log<br>[INFO] GraphLab Server Version: 1.3.0.gpu<br>Resizing images...<br>Data Augmentation...<br>Training Model...<br>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65896",
      "postDate": "03/10/2015 17:33:55",
      "content": "<p>Here is the error message</p>\n<p>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65897",
      "postDate": "03/10/2015 17:36:44",
      "content": "<p>The conf file is right. Did you fork the repo or did you copy only the python script?</p>\n<p>If you did the latter, you need to also copy network.conf and lay it out so that network.conf is in the same directory as submission script.</p>\n<p>If both these statements don't help, can I see the error?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65901",
      "postDate": "03/10/2015 18:17:46",
      "content": "<p>Here is the error message,</p>\n<p>jkao@debian:~/Media/datascience-bowl$ python make_submission.py <br>Loading images...<br>[INFO] Start server at: ipc:///tmp/graphlab_server-6138 - Server binary: /home/jkao/anaconda/lib/python2.7/site-packages/graphlab/unity_server - Server log: /tmp/graphlab_server_1426008465.log<br>[INFO] GraphLab Server Version: 1.3.0.gpu<br>Resizing images...<br>Data Augmentation...<br>Training Model...<br>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65902",
      "postDate": "03/10/2015 18:19:17",
      "content": "<p>File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66000",
      "postDate": "03/12/2015 02:04:11",
      "content": "<p>Yes, it work now after I fix an installation issue. Thanks</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66197",
      "postDate": "03/14/2015 18:39:53",
      "content": "<p>Hi Srikrishna,</p>\n\n<p>This is a great piece of code. Thanks for sharing. Just curious - you have taken max_iterations as 50 to train your model. How long does it take for each iteration? Also how many examples per second?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66199",
      "postDate": "03/14/2015 18:49:08",
      "content": "<p>It should take around 20 mins on a GPU i.e 2K-4K examples per second. It could take much longer on a CPU.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66200",
      "postDate": "03/14/2015 18:57:44",
      "content": "<p>Which GPU are you using? How long do you think it would take on NVIDIA GTX 660M with 512 MB RAM?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66209",
      "postDate": "03/14/2015 20:50:37",
      "content": "<p>I figured out&nbsp;the issue.&nbsp;</p>\n\n<p>http://forum.dato.com/discussion/780/how-to-install-graphlab-create-gpu-version-and-use-gpu-acceleration-properly</p>\n\n<p>Graphlab is not available for Mac OS X. It works, but it only works on the CPU.&nbsp;Creating neuralnet using device = cpu&quot; is not changed into 'gpu'. GPU functionality is not integrated into Dato yet.&nbsp;</p>\n\n<p>On the CPU it takes more than an hour for each iteration.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66214",
      "postDate": "03/14/2015 23:20:32",
      "content": "<p>[quote=Srikrishna Sridhar;65818]</p>\n<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing this!</p>\n<p>I've just tried it&nbsp;and it looks like it use cpu by default.</p>\n<p>Can you please let me know how to change it to use gpu?</p>\n<p>Thanks!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66218",
      "postDate": "03/15/2015 01:41:40",
      "content": "<p>I've tried it - it works great, but you mentioned that you performed some sort of fix to make the validation score more accurately reflect the LB score? &nbsp;But it still looks to be getting about 0.77 while the submitted score is about 0.93 or so.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66219",
      "postDate": "03/15/2015 02:27:30",
      "content": "<p>The fix was suggested by James King. You would need to move the random split to happen before the data augmentation step. That was the only thing needed. I haven't yet updated the code. I will do so soon.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66256",
      "postDate": "03/15/2015 18:20:25",
      "content": "<p>Thank you very much for this code. I'm just wondering which part of Dato is eligible for kaggle prize. It seems I still need to be registered to use&nbsp;GraphLab Create.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66273",
      "postDate": "03/15/2015 20:30:11",
      "content": "<p>I am not a lawyer so don't quote me on this one.</p>\n<p>The SFrame (the dataframe used in the code) is open source. The neural network uses CXXNET and the image transformations use Pillow so in theory everything in that code base can (in theory) be implemented with purely open source components.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66286",
      "postDate": "03/15/2015 21:21:15",
      "content": "<p>[quote=clustifier;66214]</p>\n<p>[quote=Srikrishna Sridhar;65818]</p>\n<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing this!</p>\n<p>I've just tried it&nbsp;and it looks like it use cpu by default.</p>\n<p>Can you please let me know how to change it to use gpu?</p>\n<p>Thanks!</p>\n<p>[/quote]</p>\n<p>@clustifier</p>\n<p>Did you fix the issue of setting CPU to GPU?</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 65827,
      "author_name": "jfkingiii",
      "author_url": "",
      "post_date": "03/10/2015 00:52:45",
      "content": "<p>It looks like both your train and validation sets are augmented, thus your overfit. If you split the data before augmentation and then only augment the train, I think your validation score will be much closer to your leaderboard score.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65828,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 01:15:13",
      "content": "<p>James,</p>\n<p>Good catch! I didn't see that. I moved the train/validation step to before the augmentation step and I get a validation score of 0.95 which is comparable to the leaderboard score.&nbsp;</p>\n<p>I will update the github code.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65846,
      "author_name": "",
      "author_url": "",
      "post_date": "03/10/2015 02:47:29",
      "content": "<p>is this code mean u set color channel to 3&nbsp;?</p>\n<p>input_shape = 3,48,48</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65847,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 02:48:34",
      "content": "<p>I don't think that should matter. I can confirm and let you know.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65848,
      "author_name": "liangpang",
      "author_url": "",
      "post_date": "03/10/2015 02:50:06",
      "content": "<p>What's your train set and validation set ratio?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65849,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 02:51:21",
      "content": "<p>I set it to 95-5% and maintained the class ratio to be the same in both sets.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65850,
      "author_name": "liangpang",
      "author_url": "",
      "post_date": "03/10/2015 02:54:47",
      "content": "<p>OK, as our team's&nbsp;experience, that's very unstable. If you split another 95%-5% set and use the same model same setting, the result will change a lot.</p>\n<p>I think 75%-25% would be stable.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65854,
      "author_name": "",
      "author_url": "",
      "post_date": "03/10/2015 03:37:09",
      "content": "<p>hi Liang Pang</p>\n<p>are you using similar network architecture like&nbsp;Srikrishna ? You don't have to give any deep details. just general info like is it more deeper</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65858,
      "author_name": "devinanzelmo",
      "author_url": "",
      "post_date": "03/10/2015 04:36:18",
      "content": "<p>This worked for me. Took a bit over an hour with gtx 750. Make sure you have the sample submission in the same directory as the python script or it will fail to make submission.csv.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65859,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 04:39:31",
      "content": "<p>I am glad this worked. Most of time is spent in averaging a prediction from random crops.</p>\n<p>I will add the submission.csv requirement to the README.md. That was only required because the submission required the columns to be sorted in an odd way.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65860,
      "author_name": "liangpang",
      "author_url": "",
      "post_date": "03/10/2015 04:43:07",
      "content": "<p>@Data-Lover Yeah, my model is deeper than Srikrishna.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65861,
      "author_name": "vvarkey",
      "author_url": "",
      "post_date": "03/10/2015 04:56:50",
      "content": "<p>[quote=Srikrishna Sridhar;65859]</p>\n<p>I am glad this worked. Most of time is spent in averaging a prediction from random crops.</p>\n<p>I will add the submission.csv requirement to the README.md. That was only required because the submission required the columns to be sorted in an odd way.</p>\n<p>[/quote]</p>\n\n<p>the columns can be in any order actually.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65863,
      "author_name": "vvarkey",
      "author_url": "",
      "post_date": "03/10/2015 05:41:40",
      "content": "<p>This code runs on &quot;GraphLab-Create&quot;, which is neither free, nor open-source. Results you get from it are ineligible in this competition.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65864,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 06:19:28",
      "content": "<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65876,
      "author_name": "potamitis",
      "author_url": "",
      "post_date": "03/10/2015 13:24:16",
      "content": "<p>[quote=Srikrishna Sridhar;65864]</p>\n<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>\n<p>[/quote]</p>\n<p>Thank you for your contribution. Any clue for the following problem? </p>\n<p>import graphlab as gl<br>Traceback (most recent call last):</p>\n<p>File &quot;&lt;ipython-input-1-4a710214f762&gt;&quot;, line 1, in &lt;module&gt;<br> import graphlab as gl</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/__init__.py&quot;, line 37, in &lt;module&gt;<br> import graphlab.deploy</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/__init__.py&quot;, line 26, in &lt;module&gt;<br> _default_session = _session._open()</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 532, in _open<br> return Session(location)</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 111, in __init__<br> self._lock = _lockfile.LockFile(_os.path.join(self.location, 'lock'))</p>\n<p>AttributeError: 'module' object has no attribute 'LockFile'</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65885,
      "author_name": "hasselmann",
      "author_url": "",
      "post_date": "03/10/2015 14:53:39",
      "content": "<p>Thanks for the guide. I am trying to understand the data augmentation you use: you resize first to 64x64, then do 90,180,270 deg. rotations which gives you four times as many images. Then you do random crops to 48x48 and also random mirroring. How many random crops and mirroring operations do you do? How many images you create through your data augmentation for each training image?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65889,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 16:15:57",
      "content": "<p>@nils Each time the image is seen during training, random crop of size 48x48 is taken. The same for predict time (which is why I average predictions). Hence, I only have 4 rotated copies of the image i.e fixed size rotations. I am not experimenting with other augmentation techniques that were discussed in another forum post.</p>\n\n<p>@Rafeal I don't use anaconda and it seems like that might be an issue. It could be a conflict of lockfile packages 0.9 vs 0.10. Try installing lockfile 0.9 instead of 0.10. (Just a guess)</p>\n<p>I filed an issue&nbsp;https://github.com/srikris/datascience-bowl/issues/1 near the source so if you figure out how to get it work or have more discussions, I can help here.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65893,
      "author_name": "sudalairajkumar",
      "author_url": "",
      "post_date": "03/10/2015 17:02:47",
      "content": "<p>[quote=Rafael;65876]</p>\n<p>[quote=Srikrishna Sridhar;65864]</p>\n<p>Just to clarify, GraphLab&nbsp;is&nbsp;free for personal/Kaggle/non-commercial use and majority of its components are open source (<a href=\"https://github.com/dato-code/Dato-Core\">see here</a>) including the pieces I have used. The network can be saved to a&nbsp;CXXNET configuration file and the code can run on it. I use it&nbsp;because I find it more convenient to work with data frames than image files.</p>\n<p>[/quote]</p>\n<p>Thank you for your contribution. Any clue for the following problem?</p>\n<p>import graphlab as gl<br>Traceback (most recent call last):</p>\n<p>File &quot;&lt;ipython-input-1-4a710214f762&gt;&quot;, line 1, in &lt;module&gt;<br> import graphlab as gl</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/__init__.py&quot;, line 37, in &lt;module&gt;<br> import graphlab.deploy</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/__init__.py&quot;, line 26, in &lt;module&gt;<br> _default_session = _session._open()</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 532, in _open<br> return Session(location)</p>\n<p>File &quot;/home/midas/anaconda_2/lib/python2.7/site-packages/graphlab/deploy/_session.py&quot;, line 111, in __init__<br> self._lock = _lockfile.LockFile(_os.path.join(self.location, 'lock'))</p>\n<p>AttributeError: 'module' object has no attribute 'LockFile'</p>\n<p>[/quote]</p>\n\n<p>When I searched for a solution, I stumbled&nbsp;up on the discussion&nbsp;<a href=\"https://bugs.launchpad.net/pylockfile/+bug/1422238\">here</a>. It seems that in lockfile 0.10.2, &nbsp;lockfile.FileLock is available. So a dirty fix would be to use FileLock in place of LockFile. &nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65894,
      "author_name": "jiweiliu",
      "author_url": "",
      "post_date": "03/10/2015 17:12:33",
      "content": "<p>[quote=SRK;65893]</p>\n<p>When I searched for a solution, I stumbled&nbsp;up on the discussion&nbsp;<a href=\"https://bugs.launchpad.net/pylockfile/+bug/1422238\">here</a>. It seems that in lockfile 0.10.2, &nbsp;lockfile.FileLock is available. So a dirty fix would be to use FileLock in place of LockFile. &nbsp;</p>\n<p>[/quote]</p>\n<p>Yeah, it fixes! thank you!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65895,
      "author_name": "junghongkao",
      "author_url": "",
      "post_date": "03/10/2015 17:31:44",
      "content": "<p>Is any missed in network.conf ? I run into the following error.</p>\n<p>jkao@debian:~/Media/datascience-bowl$ python make_submission.py <br>Loading images...<br>[INFO] Start server at: ipc:///tmp/graphlab_server-6138 - Server binary: /home/jkao/anaconda/lib/python2.7/site-packages/graphlab/unity_server - Server log: /tmp/graphlab_server_1426008465.log<br>[INFO] GraphLab Server Version: 1.3.0.gpu<br>Resizing images...<br>Data Augmentation...<br>Training Model...<br>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65896,
      "author_name": "junghongkao",
      "author_url": "",
      "post_date": "03/10/2015 17:33:55",
      "content": "<p>Here is the error message</p>\n<p>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65897,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/10/2015 17:36:44",
      "content": "<p>The conf file is right. Did you fork the repo or did you copy only the python script?</p>\n<p>If you did the latter, you need to also copy network.conf and lay it out so that network.conf is in the same directory as submission script.</p>\n<p>If both these statements don't help, can I see the error?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65901,
      "author_name": "junghongkao",
      "author_url": "",
      "post_date": "03/10/2015 18:17:46",
      "content": "<p>Here is the error message,</p>\n<p>jkao@debian:~/Media/datascience-bowl$ python make_submission.py <br>Loading images...<br>[INFO] Start server at: ipc:///tmp/graphlab_server-6138 - Server binary: /home/jkao/anaconda/lib/python2.7/site-packages/graphlab/unity_server - Server log: /tmp/graphlab_server_1426008465.log<br>[INFO] GraphLab Server Version: 1.3.0.gpu<br>Resizing images...<br>Data Augmentation...<br>Training Model...<br>Traceback (most recent call last):<br> File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65902,
      "author_name": "junghongkao",
      "author_url": "",
      "post_date": "03/10/2015 18:19:17",
      "content": "<p>File &quot;make_submission.py&quot;, line 143, in &lt;module&gt;<br> random_crop=True)<br> File &quot;/home/jkao/anaconda/lib/python2.7/site-packages/graphlab/toolkits/classifier/neuralnet_classifier.py&quot;, line 950, in create<br> raise ValueError(e.message + &quot;\\n&quot; + msg)<br>ValueError: The last FullConnectionLayer must have the same number of hidden units<br> as the number of output classes. Try setting num_hidden_units to 80.<br>The input network is valid, but is not compatible with the input and output shape of the dataset.<br>Please change the network and use net.verify() with input_shape=[64, 64, 3], and output_shape=80<br>[INFO] Stopping the server connection.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66000,
      "author_name": "junghongkao",
      "author_url": "",
      "post_date": "03/12/2015 02:04:11",
      "content": "<p>Yes, it work now after I fix an installation issue. Thanks</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66197,
      "author_name": "abhisheksimhadri",
      "author_url": "",
      "post_date": "03/14/2015 18:39:53",
      "content": "<p>Hi Srikrishna,</p>\n\n<p>This is a great piece of code. Thanks for sharing. Just curious - you have taken max_iterations as 50 to train your model. How long does it take for each iteration? Also how many examples per second?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66199,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/14/2015 18:49:08",
      "content": "<p>It should take around 20 mins on a GPU i.e 2K-4K examples per second. It could take much longer on a CPU.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66200,
      "author_name": "abhisheksimhadri",
      "author_url": "",
      "post_date": "03/14/2015 18:57:44",
      "content": "<p>Which GPU are you using? How long do you think it would take on NVIDIA GTX 660M with 512 MB RAM?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66209,
      "author_name": "abhisheksimhadri",
      "author_url": "",
      "post_date": "03/14/2015 20:50:37",
      "content": "<p>I figured out&nbsp;the issue.&nbsp;</p>\n\n<p>http://forum.dato.com/discussion/780/how-to-install-graphlab-create-gpu-version-and-use-gpu-acceleration-properly</p>\n\n<p>Graphlab is not available for Mac OS X. It works, but it only works on the CPU.&nbsp;Creating neuralnet using device = cpu&quot; is not changed into 'gpu'. GPU functionality is not integrated into Dato yet.&nbsp;</p>\n\n<p>On the CPU it takes more than an hour for each iteration.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66214,
      "author_name": "clustifier",
      "author_url": "",
      "post_date": "03/14/2015 23:20:32",
      "content": "<p>[quote=Srikrishna Sridhar;65818]</p>\n<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing this!</p>\n<p>I've just tried it&nbsp;and it looks like it use cpu by default.</p>\n<p>Can you please let me know how to change it to use gpu?</p>\n<p>Thanks!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66218,
      "author_name": "phillipadkins",
      "author_url": "",
      "post_date": "03/15/2015 01:41:40",
      "content": "<p>I've tried it - it works great, but you mentioned that you performed some sort of fix to make the validation score more accurately reflect the LB score? &nbsp;But it still looks to be getting about 0.77 while the submitted score is about 0.93 or so.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66219,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/15/2015 02:27:30",
      "content": "<p>The fix was suggested by James King. You would need to move the random split to happen before the data augmentation step. That was the only thing needed. I haven't yet updated the code. I will do so soon.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66256,
      "author_name": "jiweiliu",
      "author_url": "",
      "post_date": "03/15/2015 18:20:25",
      "content": "<p>Thank you very much for this code. I'm just wondering which part of Dato is eligible for kaggle prize. It seems I still need to be registered to use&nbsp;GraphLab Create.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66273,
      "author_name": "srikris",
      "author_url": "",
      "post_date": "03/15/2015 20:30:11",
      "content": "<p>I am not a lawyer so don't quote me on this one.</p>\n<p>The SFrame (the dataframe used in the code) is open source. The neural network uses CXXNET and the image transformations use Pillow so in theory everything in that code base can (in theory) be implemented with purely open source components.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66286,
      "author_name": "nikeshbajaj",
      "author_url": "",
      "post_date": "03/15/2015 21:21:15",
      "content": "<p>[quote=clustifier;66214]</p>\n<p>[quote=Srikrishna Sridhar;65818]</p>\n<p>Hi all,</p>\n<p>I just made a guide of how to use conv net to achieve a score of 0.93. It takes less than an hour to get the result on a GPU out of which only 10 mins is required for model training.</p>\n<p>Getting started:&nbsp;https://github.com/srikris/datascience-bowl</p>\n<p>Please let me know if you have any issues.</p>\n<p>There is a simple pip install step that you need to pick up the dependencies.</p>\n<p>Setup time: ~2 mins<br>Train time: ~20 mins on a GPU (it could take much longer on a CPU)<br>Validation score: 0.76<br>Leaderboard score: 0.97</p>\n<p>I am still investigating why&nbsp;I am overfitting. Let me know if you have any feedback.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing this!</p>\n<p>I've just tried it&nbsp;and it looks like it use cpu by default.</p>\n<p>Can you please let me know how to change it to use gpu?</p>\n<p>Thanks!</p>\n<p>[/quote]</p>\n<p>@clustifier</p>\n<p>Did you fix the issue of setting CPU to GPU?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "65818": "",
    "65827": "",
    "65828": "",
    "65846": "",
    "65847": "",
    "65848": "",
    "65849": "",
    "65850": "",
    "65854": "",
    "65858": "",
    "65859": "",
    "65860": "",
    "65861": "",
    "65863": "",
    "65864": "",
    "65876": "",
    "65885": "",
    "65889": "",
    "65893": "",
    "65894": "",
    "65895": "",
    "65896": "",
    "65897": "",
    "65901": "",
    "65902": "",
    "66000": "",
    "66197": "",
    "66199": "",
    "66200": "",
    "66209": "",
    "66214": "",
    "66218": "",
    "66219": "",
    "66256": "",
    "66273": "",
    "66286": ""
  },
  "source": "meta"
}