{
  "id": 4416,
  "title": "error loading pkl file",
  "url": "/competitions/challenges-in-representation-learning-multi-modal-learning/discussion/4416",
  "author_name": "",
  "post_date": "2013-04-23T18:35:18.073Z",
  "votes": null,
  "comment_count": 10,
  "views": 4109,
  "content": "<p>I am working on recreating the baseline solutions.&nbsp; I have completed the first 7 steps.&nbsp; When I run &quot;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">python make_submission.py mlp.pkl public_test</span>&quot; I get the following&nbsp;error\r\n while loading the pkl file:</p>\r\n<p>&nbsp; File &quot;C:\\...\\Theano\\theano\\sandbox\\cuda\\type.py&quot;, line 469, in CudaNdarray_unpickler<br>\r\n&nbsp;&nbsp;&nbsp; return cuda.CudaNdarray(npa)<br>\r\nAttributeError: (&quot;'NoneType' object has no attribute 'CudaNdarray'&quot;, &lt;function CudaNdarray_unpickler ...</p>\r\n<p>This is the first time I've used Theano.&nbsp; Is there any additional configuration of Theano I need to do to get this to run?</p>\r\n<p>Thanks,</p>\r\n<p>Steve</p>",
  "messages": [
    {
      "id": "23373",
      "postDate": "04/23/2013 18:35:18",
      "content": "<p>I am working on recreating the baseline solutions.&nbsp; I have completed the first 7 steps.&nbsp; When I run &quot;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">python make_submission.py mlp.pkl public_test</span>&quot; I get the following&nbsp;error\r\n while loading the pkl file:</p>\r\n<p>&nbsp; File &quot;C:\\...\\Theano\\theano\\sandbox\\cuda\\type.py&quot;, line 469, in CudaNdarray_unpickler<br>\r\n&nbsp;&nbsp;&nbsp; return cuda.CudaNdarray(npa)<br>\r\nAttributeError: (&quot;'NoneType' object has no attribute 'CudaNdarray'&quot;, &lt;function CudaNdarray_unpickler ...</p>\r\n<p>This is the first time I've used Theano.&nbsp; Is there any additional configuration of Theano I need to do to get this to run?</p>\r\n<p>Thanks,</p>\r\n<p>Steve</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23376",
      "postDate": "04/23/2013 19:02:03",
      "content": "<p>If you trained the model on a GPU, you'll need to unpickle on a computer that has a GPU available too. Do you think that's what's going on?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23378",
      "postDate": "04/23/2013 19:39:10",
      "content": "<p>My graphics card is an&nbsp;Intel Graphics Media &nbsp;Accelerator HD.&nbsp; GPU is Arrandale.</p>\r\n<p>Does it need to be a CUDA-enabled GPU to load the mlp.pkl model?</p>\r\n<p>Thanks,</p>\r\n<p>Steve</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23380",
      "postDate": "04/23/2013 19:43:02",
      "content": "<p>Who made the .pkl file, on which machine? Did you train it yourself, on that same machine? If so, it's weird that theano is trying to use the CudaNdarrayUnpickler.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23381",
      "postDate": "04/23/2013 19:48:12",
      "content": "<p>At this point I am just trying to load the mlp.pkl file that I downloaded from&nbsp;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">http://www-etud.iro.umontreal.ca/~goodfeli/mlp.pkl</span> in step #7 of the &quot;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">run\r\n the example baselines</span>&quot; instructions.&nbsp; Thank you.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23382",
      "postDate": "04/23/2013 19:52:22",
      "content": "<p>Oh, sorry. I thought I had converted everything back to numpy ndarrays, but I guess not. I'll post here again when I've updated the pkl file to work without GPU. I really hate the way theano pickles things.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23385",
      "postDate": "04/23/2013 21:32:43",
      "content": "<p>I'm sorry. Theano is doing something that I just don't understand, and I have no idea how to fix it. My conversion script is evidently missing a CUDA variable that theano has created behind the scenes. If I try to step through the pickle file manually and\r\n look for all possible theano variables, something causes a seg fault and crashes the python interpreter, probably indicating a bug in Theano's C code somewhere. If you can get access to a CUDA-enabled GPU, the pickle files should work. I'll write to the theano-users\r\n e-mail list to see if anyone knows how to convert it, but Frederic Bastien says there's no easy way, and he's the person who's most likely to know how.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23391",
      "postDate": "04/24/2013 00:06:16",
      "content": "<p>Okay.&nbsp; Thank you for looking into it.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23394",
      "postDate": "04/24/2013 01:30:07",
      "content": "<p>I think I've fixed it! I managed to parse the object with different calls that luckily happened to avoid whatever made theano seg fault. Try using this file:</p>\r\n<p>http://www-etud.iro.umontreal.ca/~goodfeli/logreg_best_cpu.pkl</p>\r\n<p>If it works for you I'll update the README in the main repository.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23395",
      "postDate": "04/24/2013 01:34:46",
      "content": "<p>Luckily, the same script also worked for the mlp:</p>\r\n<p>http://www-etud.iro.umontreal.ca/~goodfeli/mlp_cpu.pkl</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23397",
      "postDate": "04/24/2013 02:39:00",
      "content": "<p>That seems to have done the trick!&nbsp; I ran both models for a subset of the images, and they both worked.&nbsp;&nbsp;And&nbsp;I assume it will&nbsp;scale up to the full 500 images without any problem.&nbsp;</p>\r\n<p>Thanks again!</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 23376,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/23/2013 19:02:03",
      "content": "<p>If you trained the model on a GPU, you'll need to unpickle on a computer that has a GPU available too. Do you think that's what's going on?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23378,
      "author_name": "breakfastpirate",
      "author_url": "",
      "post_date": "04/23/2013 19:39:10",
      "content": "<p>My graphics card is an&nbsp;Intel Graphics Media &nbsp;Accelerator HD.&nbsp; GPU is Arrandale.</p>\r\n<p>Does it need to be a CUDA-enabled GPU to load the mlp.pkl model?</p>\r\n<p>Thanks,</p>\r\n<p>Steve</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23380,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/23/2013 19:43:02",
      "content": "<p>Who made the .pkl file, on which machine? Did you train it yourself, on that same machine? If so, it's weird that theano is trying to use the CudaNdarrayUnpickler.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23381,
      "author_name": "breakfastpirate",
      "author_url": "",
      "post_date": "04/23/2013 19:48:12",
      "content": "<p>At this point I am just trying to load the mlp.pkl file that I downloaded from&nbsp;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">http://www-etud.iro.umontreal.ca/~goodfeli/mlp.pkl</span> in step #7 of the &quot;<span style=\"color:#333333; line-height:115%; font-family:Consolas; font-size:9pt\">run\r\n the example baselines</span>&quot; instructions.&nbsp; Thank you.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23382,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/23/2013 19:52:22",
      "content": "<p>Oh, sorry. I thought I had converted everything back to numpy ndarrays, but I guess not. I'll post here again when I've updated the pkl file to work without GPU. I really hate the way theano pickles things.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23385,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/23/2013 21:32:43",
      "content": "<p>I'm sorry. Theano is doing something that I just don't understand, and I have no idea how to fix it. My conversion script is evidently missing a CUDA variable that theano has created behind the scenes. If I try to step through the pickle file manually and\r\n look for all possible theano variables, something causes a seg fault and crashes the python interpreter, probably indicating a bug in Theano's C code somewhere. If you can get access to a CUDA-enabled GPU, the pickle files should work. I'll write to the theano-users\r\n e-mail list to see if anyone knows how to convert it, but Frederic Bastien says there's no easy way, and he's the person who's most likely to know how.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23391,
      "author_name": "breakfastpirate",
      "author_url": "",
      "post_date": "04/24/2013 00:06:16",
      "content": "<p>Okay.&nbsp; Thank you for looking into it.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23394,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/24/2013 01:30:07",
      "content": "<p>I think I've fixed it! I managed to parse the object with different calls that luckily happened to avoid whatever made theano seg fault. Try using this file:</p>\r\n<p>http://www-etud.iro.umontreal.ca/~goodfeli/logreg_best_cpu.pkl</p>\r\n<p>If it works for you I'll update the README in the main repository.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23395,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "04/24/2013 01:34:46",
      "content": "<p>Luckily, the same script also worked for the mlp:</p>\r\n<p>http://www-etud.iro.umontreal.ca/~goodfeli/mlp_cpu.pkl</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23397,
      "author_name": "breakfastpirate",
      "author_url": "",
      "post_date": "04/24/2013 02:39:00",
      "content": "<p>That seems to have done the trick!&nbsp; I ran both models for a subset of the images, and they both worked.&nbsp;&nbsp;And&nbsp;I assume it will&nbsp;scale up to the full 500 images without any problem.&nbsp;</p>\r\n<p>Thanks again!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "23373": "",
    "23376": "",
    "23378": "",
    "23380": "",
    "23381": "",
    "23382": "",
    "23385": "",
    "23391": "",
    "23394": "",
    "23395": "",
    "23397": ""
  },
  "source": "meta"
}