{
  "id": 4501,
  "title": "Running python from R",
  "url": "/competitions/challenges-in-representation-learning-the-black-box-learning-challenge/discussion/4501",
  "author_name": "",
  "post_date": "2013-05-04T12:08:43.660Z",
  "votes": null,
  "comment_count": 5,
  "views": 6033,
  "content": "<p>I'm trying run the python scripts from R. Something like this:</p>\r\n<pre>setwd('c:/anaconda/lib/site-packages/pylearn2/scripts/icml_2013_wrepl/black_box')<br>system('cd c:/anaconda/lib/site-packages/pylearn2/scripts/icml_2013_wrepl/black_box')<br>system('python train.py mlp.yaml')</pre>\r\n<p>but the compiler fail.</p>\r\n<p>(From cmd on windows the python scrips run fine)</p>\r\n<p>Some tip for fix it?</p>\r\n<pre>Problem occurred during compilation with the command line below:<br>g&#43;&#43; -shared -g -O3 -Wno-write-strings -Wno-unused-label -Wno-unused-variable -fno-math-errno -DMS_WIN64 -m64 -IC:\\Anaconda\\lib\\site-packages\\numpy\\core\\include -IC:\\Anaconda\\include -o C:\\Users\\JAG\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\tmph_sqib\\baf8a6fdee34b135ea9110785e356489.pyd C:\\Users\\JAG\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\tmph_sqib\\mod.cpp -LC:\\Anaconda\\libs -LC:\\Anaconda -lpython27 -lblas<br>Traceback (most recent call last):<br>  File &quot;train.py&quot;, line 141, in &lt;module&gt;<br>    train_obj.main_loop()<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\train.py&quot;, line 109, in main_loop<br>    self.algorithm.setup(model=self.model, dataset=self.dataset)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\training_algorithms\\sgd.py&quot;, line 285, in setup<br>    mode=self.theano_function_mode)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function.py&quot;, line 221, in function<br>    profile=profile)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\pfunc.py&quot;, line 506, in pfunc<br>    on_unused_input=on_unused_input)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1339, in orig_function<br>    defaults)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1167, in create<br>    _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\link.py&quot;, line 383, in make_thunk<br>    output_storage = output_storage)[:3]<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\vm.py&quot;, line 799, in make_all<br>    for node in order]<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\op.py&quot;, line 580, in make_thunk<br>    output_storage=node_output_storage)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 913, in make_thunk<br>    keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 856, in __compile__<br>    keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1279, in cthunk_factory<br>    key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 975, in module_from_key<br>    module = compile_steps.next()<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1201, in compile_cmodule_by_step<br>    preargs=preargs)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 1633, in compile_str<br>    (status, compile_stderr.replace('\\n', '. ')))<br>Exception: ('Compilation failed (return status=1): In file included from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarraytypes.h:1728:0,\\r.                  from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarrayobject.h:17,\\r.                  from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/arrayobject.h:15,\\r.                  from C:\\\\Users\\\\JAG\\\\AppData\\\\Local\\\\Theano\\\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\\\tmph_sqib\\\\mod.cpp:3:\\r. C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h:9:82: note: #pragma message: C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h(8) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\\r. c:/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas\\r. collect2.exe: error: ld returned 1 exit status\\r. ', '[_dot22(SGD[X], h0_W)]')<br>Mensajes de aviso perdidos<br>comando ejecutado 'python train.py mlp.yaml' tiene estatus 1 </pre>\r\n<pre>&nbsp;</pre>",
  "messages": [
    {
      "id": "23889",
      "postDate": "05/04/2013 12:08:43",
      "content": "<p>I'm trying run the python scripts from R. Something like this:</p>\r\n<pre>setwd('c:/anaconda/lib/site-packages/pylearn2/scripts/icml_2013_wrepl/black_box')<br>system('cd c:/anaconda/lib/site-packages/pylearn2/scripts/icml_2013_wrepl/black_box')<br>system('python train.py mlp.yaml')</pre>\r\n<p>but the compiler fail.</p>\r\n<p>(From cmd on windows the python scrips run fine)</p>\r\n<p>Some tip for fix it?</p>\r\n<pre>Problem occurred during compilation with the command line below:<br>g&#43;&#43; -shared -g -O3 -Wno-write-strings -Wno-unused-label -Wno-unused-variable -fno-math-errno -DMS_WIN64 -m64 -IC:\\Anaconda\\lib\\site-packages\\numpy\\core\\include -IC:\\Anaconda\\include -o C:\\Users\\JAG\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\tmph_sqib\\baf8a6fdee34b135ea9110785e356489.pyd C:\\Users\\JAG\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\tmph_sqib\\mod.cpp -LC:\\Anaconda\\libs -LC:\\Anaconda -lpython27 -lblas<br>Traceback (most recent call last):<br>  File &quot;train.py&quot;, line 141, in &lt;module&gt;<br>    train_obj.main_loop()<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\train.py&quot;, line 109, in main_loop<br>    self.algorithm.setup(model=self.model, dataset=self.dataset)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\training_algorithms\\sgd.py&quot;, line 285, in setup<br>    mode=self.theano_function_mode)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function.py&quot;, line 221, in function<br>    profile=profile)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\pfunc.py&quot;, line 506, in pfunc<br>    on_unused_input=on_unused_input)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1339, in orig_function<br>    defaults)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1167, in create<br>    _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\link.py&quot;, line 383, in make_thunk<br>    output_storage = output_storage)[:3]<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\vm.py&quot;, line 799, in make_all<br>    for node in order]<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\op.py&quot;, line 580, in make_thunk<br>    output_storage=node_output_storage)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 913, in make_thunk<br>    keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 856, in __compile__<br>    keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1279, in cthunk_factory<br>    key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 975, in module_from_key<br>    module = compile_steps.next()<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1201, in compile_cmodule_by_step<br>    preargs=preargs)<br>  File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 1633, in compile_str<br>    (status, compile_stderr.replace('\\n', '. ')))<br>Exception: ('Compilation failed (return status=1): In file included from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarraytypes.h:1728:0,\\r.                  from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarrayobject.h:17,\\r.                  from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/arrayobject.h:15,\\r.                  from C:\\\\Users\\\\JAG\\\\AppData\\\\Local\\\\Theano\\\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.3\\\\tmph_sqib\\\\mod.cpp:3:\\r. C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h:9:82: note: #pragma message: C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h(8) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\\r. c:/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas\\r. collect2.exe: error: ld returned 1 exit status\\r. ', '[_dot22(SGD[X], h0_W)]')<br>Mensajes de aviso perdidos<br>comando ejecutado 'python train.py mlp.yaml' tiene estatus 1 </pre>\r\n<pre>&nbsp;</pre>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23955",
      "postDate": "05/06/2013 21:45:19",
      "content": "<p>I am having a problem similar to Jose. &nbsp;I am running into problems running the benchmark pylearn2 python scripts from within R, but they work fine from the Windows command line. &nbsp;Any chance someone knows how to solve this?</p>\r\n<p><span style=\"line-height:1.4em\">I am running Anaconda python on Windows 7 64.</span></p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"line-height:1.4em\">The problem occurs right as it reports &quot;Compiling sgd_update...&quot;</span></p>\r\n<p>&nbsp;</p>\r\n<blockquote>\r\n<pre>&nbsp;</pre>\r\n<pre>&gt; shell(&quot;C:/Archive/AWS/BlackBox/python_batch_R.bat&quot;, intern=FALSE, translate=TRUE)</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;cd c:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box </pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;python ..\\..\\train.py mlp_R.yaml </pre>\r\n<pre>Parameter and initial learning rate summary:</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;cd c:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box </pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;python ..\\..\\train.py mlp_R.yaml </pre>\r\n<pre>Parameter and initial learning rate summary:</pre>\r\n<pre>C:\\Anaconda\\lib\\site-packages\\pylearn2\\models\\mlp.py:40: UserWarning: MLP changing the recursion limit.</pre>\r\n<pre>&nbsp; warnings.warn(&quot;MLP changing the recursion limit.&quot;)</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h0_W: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h0_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h1_W: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h1_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; softmax_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; softmax_W: 0.1</pre>\r\n<pre>Compiling sgd_update...</pre>\r\n<pre>00001&nbsp;&nbsp; #include &lt;Python.h&gt;</pre>\r\n<pre>00002&nbsp;&nbsp; #include &lt;iostream&gt;</pre>\r\n<pre>00003&nbsp;&nbsp; #include &lt;numpy/arrayobject.h&gt;</pre>\r\n<pre>00004&nbsp;&nbsp; #include &lt;iostream&gt;</pre>\r\n<pre>00005&nbsp;&nbsp; #include &lt;math.h&gt;</pre>\r\n<pre>00006&nbsp;&nbsp; #include &lt;sys/time.h&gt;</pre>\r\n<pre>00007&nbsp;&nbsp; #include &lt;numpy/arrayscalars.h&gt;</pre>\r\n<pre>00008&nbsp;&nbsp; #include &lt;time.h&gt;</pre>\r\n<pre>00009&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00010&nbsp;&nbsp; ////&nbsp; Support Code</pre>\r\n<pre>00011&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00012&nbsp;&nbsp; </pre>\r\n<pre>00013&nbsp;&nbsp; </pre>\r\n<pre>00014&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extern &quot;C&quot;</pre>\r\n<p>&nbsp;</p>\r\n<p>….</p>\r\n<p>&nbsp;</p>\r\n<pre>0845&nbsp;&nbsp;&nbsp; </pre>\r\n<pre>00846&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00847&nbsp;&nbsp; ////&nbsp; Module init</pre>\r\n<pre>00848&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00849&nbsp;&nbsp; static PyMethodDef MyMethods[] = {</pre>\r\n<pre>00850&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&quot;instantiate&quot;, instantiate, METH_VARARGS, &quot;undocumented&quot;} ,</pre>\r\n<pre>00851&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {NULL, NULL, 0, NULL}</pre>\r\n<pre>00852&nbsp;&nbsp; };</pre>\r\n<pre>00853&nbsp;&nbsp; PyMODINIT_FUNC initbaf8a6fdee34b135ea9110785e356489(void){</pre>\r\n<pre>00854&nbsp;&nbsp; &nbsp;&nbsp; import_array();</pre>\r\n<pre>00855&nbsp;&nbsp; &nbsp;&nbsp; (void) Py_InitModule(&quot;baf8a6fdee34b135ea9110785e356489&quot;, MyMethods);</pre>\r\n<pre>00856&nbsp;&nbsp; }</pre>\r\n<pre>00857&nbsp;&nbsp; </pre>\r\n<pre>Problem occurred during compilation with the command line below:</pre>\r\n<pre>g&#43;&#43; -shared -g -O3 -Wno-write-strings -Wno-unused-label -Wno-unused-variable -fno-math-errno -DMS_WIN64 -m64 -IC:\\Anaconda\\lib\\site-packages\\numpy\\core\\include -IC:\\Anaconda\\include -o C:\\Users\\Nathan\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\tmpje9pin\\baf8a6fdee34b135ea9110785e356489.pyd C:\\Users\\Nathan\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\tmpje9pin\\mod.cpp -LC:\\Anaconda\\libs -LC:\\Anaconda -lpython27 -lblas</pre>\r\n<pre>Traceback (most recent call last):</pre>\r\n<pre>&nbsp; File &quot;..\\..\\train.py&quot;, line 141, in &lt;module&gt;</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; train_obj.main_loop()</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\train.py&quot;, line 109, in main_loop</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; self.algorithm.setup(model=self.model, dataset=self.dataset)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\training_algorithms\\sgd.py&quot;, line 285, in setup</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; mode=self.theano_function_mode)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function.py&quot;, line 221, in function</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; profile=profile)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\pfunc.py&quot;, line 506, in pfunc</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; on_unused_input=on_unused_input)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1339, in orig_function</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; defaults)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1167, in create</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\link.py&quot;, line 383, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; output_storage = output_storage)[:3]</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\vm.py&quot;, line 799, in make_all</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; for node in order]</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\op.py&quot;, line 580, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; output_storage=node_output_storage)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 913, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 856, in __compile__</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1279, in cthunk_factory</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 975, in module_from_key</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; module = compile_steps.next()</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1201, in compile_cmodule_by_step</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; preargs=preargs)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 1633, in compile_str</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; (status, compile_stderr.replace('\\n', '. ')))</pre>\r\n<pre>Exception: ('Compilation failed (return status=1): In file included from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarraytypes.h:1728:0,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarrayobject.h:17,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/arrayobject.h:15,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Users\\\\Nathan\\\\AppData\\\\Local\\\\Theano\\\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\\\tmpje9pin\\\\mod.cpp:3:\\r. C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h:9:82: note: #pragma message: C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h(8) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\\r. c:/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas\\r. collect2.exe: error: ld returned 1 exit status\\r. ', '[_dot22(SGD[X], h0_W)]')</pre>\r\n<p>&nbsp;</p>\r\n<p><span style=\"line-height:1.4em\"><br>\r\n</span></p>\r\n</blockquote>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23962",
      "postDate": "05/06/2013 22:56:43",
      "content": "<p>I don't know how to do this. Maybe someone else will. As a pylearn2 developer, I'm curious why you want to be able to run pylearn2 from inside R though. Is it just for the convenience of not switching shells? Or can R use the console output somehow? I imagine\r\n R can't use the pickle file it emits.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23963",
      "postDate": "05/06/2013 22:57:11",
      "content": "<p>Hi Jose,</p>\r\n<p>&nbsp; &nbsp; Have you tried creating a .theanorc.txt file with a &quot;blas=&quot; line in it?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23990",
      "postDate": "05/07/2013 18:09:23",
      "content": "<p>[quote=Ian Goodfellow;23962]</p>\r\n<p>I don't know how to do this. Maybe someone else will. As a pylearn2 developer, I'm curious why you want to be able to run pylearn2 from inside R though. Is it just for the convenience of not switching shells? Or can R use the console output somehow? I imagine\r\n R can't use the pickle file it emits.</p>\r\n<p>[/quote]</p>\r\n<p>Ian, only for data manage in R. I'm learning python with this challenge... python,numpy,theano,pylearn2. I spend a lot of time to do things &nbsp;in python that I know how to do in R in seconds. This was the reason.</p>\r\n<p>Daniel: Thank you, &nbsp;I decided do all in python... (?!%&amp;!rrrr).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "23998",
      "postDate": "05/07/2013 21:44:34",
      "content": "<p>Problem is that .theanorc env is not visible to theano<br>\r\n<br>\r\neasy, but not best workaround is:<br>\r\n<br>\r\n1. create &nbsp;StartFromR.bat<br>\r\nwith:<br>\r\n&nbsp; &nbsp;&nbsp;<strong>train.py test7.yaml</strong><br>\r\n2. in train.py set variables (variables from .theanorc)<br>\r\n&nbsp; &nbsp; &nbsp;edit train.py:</p>\r\n<pre><em>from pylearn2.utils.timing import log_timing</em><br><br><strong>import theano</strong><br><strong>theano.config.blas.cxxflags = '-IC:\\mingw64\\include'</strong><br><strong>theano.config.blas.ldflags = ''</strong><br><br><em>log = logging.getLogger(__name__)</em></pre>\r\n<p>3. run in R<br>\r\n&gt; shell('StartFromR.bat')<br>\r\n<br>\r\n....</p>\r\n<pre>Saving to mlp2007.pkl...<br>Saving to mlp2007.pkl done. Time elapsed: 1.833000 seconds<br>Saving to mlp2007.pkl...<br>Saving to mlp2007.pkl done. Time elapsed: 1.803000 seconds<br>&gt; </pre>\r\n<p><br>\r\n&nbsp; &nbsp; &nbsp;&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 23955,
      "author_name": "bignate",
      "author_url": "",
      "post_date": "05/06/2013 21:45:19",
      "content": "<p>I am having a problem similar to Jose. &nbsp;I am running into problems running the benchmark pylearn2 python scripts from within R, but they work fine from the Windows command line. &nbsp;Any chance someone knows how to solve this?</p>\r\n<p><span style=\"line-height:1.4em\">I am running Anaconda python on Windows 7 64.</span></p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"line-height:1.4em\">The problem occurs right as it reports &quot;Compiling sgd_update...&quot;</span></p>\r\n<p>&nbsp;</p>\r\n<blockquote>\r\n<pre>&nbsp;</pre>\r\n<pre>&gt; shell(&quot;C:/Archive/AWS/BlackBox/python_batch_R.bat&quot;, intern=FALSE, translate=TRUE)</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;cd c:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box </pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;python ..\\..\\train.py mlp_R.yaml </pre>\r\n<pre>Parameter and initial learning rate summary:</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;cd c:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box </pre>\r\n<pre>&nbsp;</pre>\r\n<pre>C:\\Anaconda\\Lib\\site-packages\\pylearn2\\scripts\\icml_2013_wrepl\\black_box&gt;python ..\\..\\train.py mlp_R.yaml </pre>\r\n<pre>Parameter and initial learning rate summary:</pre>\r\n<pre>C:\\Anaconda\\lib\\site-packages\\pylearn2\\models\\mlp.py:40: UserWarning: MLP changing the recursion limit.</pre>\r\n<pre>&nbsp; warnings.warn(&quot;MLP changing the recursion limit.&quot;)</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h0_W: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h0_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h1_W: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h1_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; softmax_b: 0.1</pre>\r\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; softmax_W: 0.1</pre>\r\n<pre>Compiling sgd_update...</pre>\r\n<pre>00001&nbsp;&nbsp; #include &lt;Python.h&gt;</pre>\r\n<pre>00002&nbsp;&nbsp; #include &lt;iostream&gt;</pre>\r\n<pre>00003&nbsp;&nbsp; #include &lt;numpy/arrayobject.h&gt;</pre>\r\n<pre>00004&nbsp;&nbsp; #include &lt;iostream&gt;</pre>\r\n<pre>00005&nbsp;&nbsp; #include &lt;math.h&gt;</pre>\r\n<pre>00006&nbsp;&nbsp; #include &lt;sys/time.h&gt;</pre>\r\n<pre>00007&nbsp;&nbsp; #include &lt;numpy/arrayscalars.h&gt;</pre>\r\n<pre>00008&nbsp;&nbsp; #include &lt;time.h&gt;</pre>\r\n<pre>00009&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00010&nbsp;&nbsp; ////&nbsp; Support Code</pre>\r\n<pre>00011&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00012&nbsp;&nbsp; </pre>\r\n<pre>00013&nbsp;&nbsp; </pre>\r\n<pre>00014&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extern &quot;C&quot;</pre>\r\n<p>&nbsp;</p>\r\n<p>….</p>\r\n<p>&nbsp;</p>\r\n<pre>0845&nbsp;&nbsp;&nbsp; </pre>\r\n<pre>00846&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00847&nbsp;&nbsp; ////&nbsp; Module init</pre>\r\n<pre>00848&nbsp;&nbsp; //////////////////////</pre>\r\n<pre>00849&nbsp;&nbsp; static PyMethodDef MyMethods[] = {</pre>\r\n<pre>00850&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&quot;instantiate&quot;, instantiate, METH_VARARGS, &quot;undocumented&quot;} ,</pre>\r\n<pre>00851&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {NULL, NULL, 0, NULL}</pre>\r\n<pre>00852&nbsp;&nbsp; };</pre>\r\n<pre>00853&nbsp;&nbsp; PyMODINIT_FUNC initbaf8a6fdee34b135ea9110785e356489(void){</pre>\r\n<pre>00854&nbsp;&nbsp; &nbsp;&nbsp; import_array();</pre>\r\n<pre>00855&nbsp;&nbsp; &nbsp;&nbsp; (void) Py_InitModule(&quot;baf8a6fdee34b135ea9110785e356489&quot;, MyMethods);</pre>\r\n<pre>00856&nbsp;&nbsp; }</pre>\r\n<pre>00857&nbsp;&nbsp; </pre>\r\n<pre>Problem occurred during compilation with the command line below:</pre>\r\n<pre>g&#43;&#43; -shared -g -O3 -Wno-write-strings -Wno-unused-label -Wno-unused-variable -fno-math-errno -DMS_WIN64 -m64 -IC:\\Anaconda\\lib\\site-packages\\numpy\\core\\include -IC:\\Anaconda\\include -o C:\\Users\\Nathan\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\tmpje9pin\\baf8a6fdee34b135ea9110785e356489.pyd C:\\Users\\Nathan\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\tmpje9pin\\mod.cpp -LC:\\Anaconda\\libs -LC:\\Anaconda -lpython27 -lblas</pre>\r\n<pre>Traceback (most recent call last):</pre>\r\n<pre>&nbsp; File &quot;..\\..\\train.py&quot;, line 141, in &lt;module&gt;</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; train_obj.main_loop()</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\train.py&quot;, line 109, in main_loop</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; self.algorithm.setup(model=self.model, dataset=self.dataset)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\pylearn2\\training_algorithms\\sgd.py&quot;, line 285, in setup</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; mode=self.theano_function_mode)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function.py&quot;, line 221, in function</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; profile=profile)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\pfunc.py&quot;, line 506, in pfunc</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; on_unused_input=on_unused_input)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1339, in orig_function</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; defaults)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\compile\\function_module.py&quot;, line 1167, in create</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\link.py&quot;, line 383, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; output_storage = output_storage)[:3]</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\vm.py&quot;, line 799, in make_all</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; for node in order]</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\op.py&quot;, line 580, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; output_storage=node_output_storage)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 913, in make_thunk</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 856, in __compile__</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1279, in cthunk_factory</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 975, in module_from_key</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; module = compile_steps.next()</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cc.py&quot;, line 1201, in compile_cmodule_by_step</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; preargs=preargs)</pre>\r\n<pre>&nbsp; File &quot;C:\\Anaconda\\lib\\site-packages\\theano\\gof\\cmodule.py&quot;, line 1633, in compile_str</pre>\r\n<pre>&nbsp;&nbsp;&nbsp; (status, compile_stderr.replace('\\n', '. ')))</pre>\r\n<pre>Exception: ('Compilation failed (return status=1): In file included from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarraytypes.h:1728:0,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/ndarrayobject.h:17,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/arrayobject.h:15,\\r.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from C:\\\\Users\\\\Nathan\\\\AppData\\\\Local\\\\Theano\\\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.3\\\\tmpje9pin\\\\mod.cpp:3:\\r. C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h:9:82: note: #pragma message: C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include/numpy/npy_deprecated_api.h(8) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\\r. c:/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas\\r. collect2.exe: error: ld returned 1 exit status\\r. ', '[_dot22(SGD[X], h0_W)]')</pre>\r\n<p>&nbsp;</p>\r\n<p><span style=\"line-height:1.4em\"><br>\r\n</span></p>\r\n</blockquote>\r\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23962,
      "author_name": "iangoodfellow",
      "author_url": "",
      "post_date": "05/06/2013 22:56:43",
      "content": "<p>I don't know how to do this. Maybe someone else will. As a pylearn2 developer, I'm curious why you want to be able to run pylearn2 from inside R though. Is it just for the convenience of not switching shells? Or can R use the console output somehow? I imagine\r\n R can't use the pickle file it emits.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23963,
      "author_name": "dpineo",
      "author_url": "",
      "post_date": "05/06/2013 22:57:11",
      "content": "<p>Hi Jose,</p>\r\n<p>&nbsp; &nbsp; Have you tried creating a .theanorc.txt file with a &quot;blas=&quot; line in it?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23990,
      "author_name": "blindape",
      "author_url": "",
      "post_date": "05/07/2013 18:09:23",
      "content": "<p>[quote=Ian Goodfellow;23962]</p>\r\n<p>I don't know how to do this. Maybe someone else will. As a pylearn2 developer, I'm curious why you want to be able to run pylearn2 from inside R though. Is it just for the convenience of not switching shells? Or can R use the console output somehow? I imagine\r\n R can't use the pickle file it emits.</p>\r\n<p>[/quote]</p>\r\n<p>Ian, only for data manage in R. I'm learning python with this challenge... python,numpy,theano,pylearn2. I spend a lot of time to do things &nbsp;in python that I know how to do in R in seconds. This was the reason.</p>\r\n<p>Daniel: Thank you, &nbsp;I decided do all in python... (?!%&amp;!rrrr).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 23998,
      "author_name": "djajetic",
      "author_url": "",
      "post_date": "05/07/2013 21:44:34",
      "content": "<p>Problem is that .theanorc env is not visible to theano<br>\r\n<br>\r\neasy, but not best workaround is:<br>\r\n<br>\r\n1. create &nbsp;StartFromR.bat<br>\r\nwith:<br>\r\n&nbsp; &nbsp;&nbsp;<strong>train.py test7.yaml</strong><br>\r\n2. in train.py set variables (variables from .theanorc)<br>\r\n&nbsp; &nbsp; &nbsp;edit train.py:</p>\r\n<pre><em>from pylearn2.utils.timing import log_timing</em><br><br><strong>import theano</strong><br><strong>theano.config.blas.cxxflags = '-IC:\\mingw64\\include'</strong><br><strong>theano.config.blas.ldflags = ''</strong><br><br><em>log = logging.getLogger(__name__)</em></pre>\r\n<p>3. run in R<br>\r\n&gt; shell('StartFromR.bat')<br>\r\n<br>\r\n....</p>\r\n<pre>Saving to mlp2007.pkl...<br>Saving to mlp2007.pkl done. Time elapsed: 1.833000 seconds<br>Saving to mlp2007.pkl...<br>Saving to mlp2007.pkl done. Time elapsed: 1.803000 seconds<br>&gt; </pre>\r\n<p><br>\r\n&nbsp; &nbsp; &nbsp;&nbsp;</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "23889": "",
    "23955": "",
    "23962": "",
    "23963": "",
    "23990": "",
    "23998": ""
  },
  "source": "meta"
}