--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
OK. Thanks for the update.
Fred
--
--
--
--
--
--
Good idea.
Can you rebase now or very shortly?
We will do shortly big change to support python 2 and 3 with the same code base. Doing a rebase now will be very useful to help move the code to Theano later.
Thanks.
Fred
--
How can I find this rebase? Thanks!
------------------------
dyld: Symbol not found: _PyCObject_Type
Referenced from: /Users/ajain/.theano/compiledir_Darwin-15.0.0-x86_64-i386-64bit-i386-2.7.10-64/tmpTNtZV3/e34908c1bf4e1be2c3bc98537430b5dd.so
Expected in: flat namespace
in /Users/ajain/.theano/compiledir_Darwin-15.0.0-x86_64-i386-64bit-i386-2.7.10-64/tmpTNtZV3/e34908c1bf4e1be2c3bc98537430b5dd.so
Trace/BPT trap: 5
------------------------
python doc/shared_library_howto/function.py
===============================
00001 #include <Python.h>
00002 #include <iostream>
00003 #include "theano_mod_helper.h"
00004 #include <math.h>
00005 #include <numpy/arrayobject.h>
00006 #include <numpy/arrayscalars.h>
00007 #include <vector>
00008 #include <algorithm>
00009 #include "/home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/69b3d6139dc9f89fa029d3ce94ce3b32.h"
00010 //////////////////////
00011 //// Support Code
00012 //////////////////////
00013
00014 // Mapping: variable name -> struct internal stogare
00015 // x->storage_V7
00016 // y->storage_V13
00017 // Elemwise{mul,no_inplace}.0->storage_V17
00018 // CGemv{inplace}.0->storage_V1
00019
00020 int main(int argc, char *argv[]) {
00021 Py_SetProgramName(argv[0]); /* optional but recommended */
00022 Py_Initialize();
00023
00024 // Those print are there to help debug import of python module
00025 PyObject * numpy = PyImport_ImportModule("numpy");
00026 printf("After import numpy %p\n", numpy);
00027 PyErr_Print();
00028 //import_array{,1,2} can be called many times without problems.
00029 import_array1(1);
00030 printf("after import_array1()\n");
00031
00032 __struct_compiled_op_69b3d6139dc9f89fa029d3ce94ce3b32 *struct_ptr = cinit();
00033 int run_ret = 0;
00034 if(struct_ptr){
00035
00036 PyObject* storage_V7_data = PyArray_Arange(0., 12, 1.,NPY_FLOAT64);
00037 npy_intp storage_V7_dims[2] = {3,4};
00038 PyArray_Dims storage_V7_newshape;
00039 storage_V7_newshape.ptr = storage_V7_dims;
00040 storage_V7_newshape.len = 2;
00041 PyObject* storage_V7_value = PyArray_Newshape(
00042 (PyArrayObject*) storage_V7_data,&storage_V7_newshape,NPY_CORDER);
00043 PyList_SetItem(struct_ptr->storage_V7, 0, storage_V7_value);
00044 storage_V7_value = NULL;
00045
00046 PyObject* storage_V13_data = PyArray_Arange(0., 3, 1.,NPY_FLOAT64);
00047 npy_intp storage_V13_dims[1] = {3};
00048 PyArray_Dims storage_V13_newshape;
00049 storage_V13_newshape.ptr = storage_V13_dims;
00050 storage_V13_newshape.len = 1;
00051 PyObject* storage_V13_value = PyArray_Newshape(
00052 (PyArrayObject*) storage_V13_data,&storage_V13_newshape,NPY_CORDER);
00053 PyList_SetItem(struct_ptr->storage_V13, 0, storage_V13_value);
00054 storage_V13_value = NULL;
00055
00056 printf("after cinit()\n");
00057 //Function execution
00058 run_ret = struct_ptr->run();
00059 printf("run() from the shared library returned=%d\n", run_ret);
00060
00061 if(run_ret==0){
00062
00063 //PyList_GET_ITEM return a borrowed reference
00064 PyObject *tmp_storage_V17=PyList_GET_ITEM(struct_ptr->storage_V17, 0);
00065 PyObject_Print(tmp_storage_V17, stdout, Py_PRINT_RAW);
00066 printf("\n");
00067
00068 //PyList_GET_ITEM return a borrowed reference
00069 PyObject *tmp_storage_V1=PyList_GET_ITEM(struct_ptr->storage_V1, 0);
00070 PyObject_Print(tmp_storage_V1, stdout, Py_PRINT_RAW);
00071 printf("\n");
00072
00073 }else if(run_ret != 0){
00074 // See out_print to know why we can't call PyObject_Print on win32
00075 PyObject *str_err = PyObject_Str(struct_ptr->__ERROR);
00076 //PyString_AsString return a ptr to the internal representation.
00077 printf("Error: %s\n", PyString_AsString(str_err));
00078 Py_CLEAR(str_err);
00079 }
00080 }else{
00081 printf("cinit() failed!\n");
00082 return 1;
00083 }
00084 delete struct_ptr;
00085
00086 printf("main end, before Py_Finalize\n");
00087 Py_Finalize();
00088 return run_ret;
00089 }
00090
00091
===============================
Problem occurred during compilation with the command line below:
/usr/bin/g++ -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=core-avx2 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=25600 -mtune=generic -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC /home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/69b3d6139dc9f89fa029d3ce94ce3b32.so -fvisibility=hidden -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof -o /home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec /home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec.cpp -L/usr/lib -lpython2.7 -lpython2.7 -lblas
/tmp/cceHgXzL.o: In function `main':
/home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec.cpp:32: undefined reference to `cinit()'
/home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec.cpp:58: undefined reference to `__struct_compiled_op_69b3d6139dc9f89fa029d3ce94ce3b32::run()'
collect2: error: ld returned 1 exit status
Traceback (most recent call last):
File "doc/shared_library_howto/function.py", line 10, in <module>
f = theano.function([x, y], [2 * x, T.dot(y, x)], mode=mode)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/compile/function.py", line 310, in function
output_keys=output_keys)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/compile/pfunc.py", line 523, in pfunc
output_keys=output_keys)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/compile/function_module.py", line 1526, in orig_function
defaults)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/compile/function_module.py", line 1390, in create
input_storage=input_storage_lists)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cc.py", line 1074, in make_thunk
keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cc.py", line 1014, in __compile__
keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cc.py", line 1576, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cmodule.py", line 1116, in module_from_key
module = lnk.compile_cmodule(location)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cc.py", line 1447, in compile_cmodule
out_filename='exec')
File "/usr/local/lib/python2.7/dist-packages/Theano-0.7.0-py2.7.egg/theano/gof/cmodule.py", line 2206, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: ("Compilation failed (return status=1): /tmp/cceHgXzL.o: In function `main':. /home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec.cpp:32: undefined reference to `cinit()'. /home/ajain/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp7h6ybX/exec.cpp:58: undefined reference to `__struct_compiled_op_69b3d6139dc9f89fa029d3ce94ce3b32::run()'. collect2: error: ld returned 1 exit status. ", "[Elemwise{mul,no_inplace}(TensorConstant{(1, 1) of 2.0}, x), CGemv{inplace}(AllocEmpty{dtype='float64'}(Shape_i{1}(x)), TensorConstant{1.0}, InplaceDimShuffle{1,0}(x), y, TensorConstant{0.0})]")
--
Thanks. I'll try to check that next week. Do you know of this work with the GPU? If not don't work on it, we are moving to the new GPU back end very shortly...