Re: [theano-users] import theano issues in PCharm community edition

2017-03-31 Thread Frédéric Bastien
It probably use a different compiler in pycharm the in side.

In pycharm, it use one under C:/MinGW. Make sure to use conda compiler and
not another one.

Le jeu. 30 mars 2017 16:26, Maradani Bhavana  a
écrit :

> Hello All,
>
> I am using PyCharm IDE and anaconda (python 3.5.2). I have installed
> theano using conda. I tested with a small program in PyCharm as well as
> Spyder. The program runs well in spyder but gives issues in PyCharm IDE. I
> tried to install theano package in pyCharm IDE, but doesn't help. Below is
> the error which I get in pyCharm:
>
>
> C:\Users\Bhavana\Anaconda3\python.exe
> C:/Users/Bhavana/PycharmProjects/untitled/1.py
> ===
> 1 #include 
> 2 #include 
> 3 #include "theano_mod_helper.h"
> 4 #include 
> 5 #include 
> 6 #include 
> 7 #include 
> 8 #include 
> 9 //
> 00010   Support Code
> 00011 //
> 00012
> 00013namespace {
> 00014struct __struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707 {
> 00015PyObject* __ERROR;
> 00016
> 00017PyObject* storage_V3;
> 00018 PyObject* storage_V5;
> 00019 PyObject* storage_V1;
> 00020
> 00021
> 00022__struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707() {
> 00023// This is only somewhat safe because we:
> 00024//  1) Are not a virtual class
> 00025//  2) Do not use any virtual classes in the members
> 00026//  3) Deal with mostly POD and pointers
> 00027
> 00028// If this changes, we would have to revise this, but for
> 00029// now I am tired of chasing segfaults because
> 00030// initialization code had an error and some pointer has
> 00031// a junk value.
> 00032memset(this, 0, sizeof(*this));
> 00033}
> 00034
>  ~__struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707(void) {
> 00035cleanup();
> 00036}
> 00037
> 00038int init(PyObject* __ERROR, PyObject* storage_V3, PyObject*
> storage_V5, PyObject* storage_V1) {
> 00039Py_XINCREF(storage_V3);
> 00040 Py_XINCREF(storage_V5);
> 00041 Py_XINCREF(storage_V1);
> 00042this->storage_V3 = storage_V3;
> 00043 this->storage_V5 = storage_V5;
> 00044 this->storage_V1 = storage_V1;
> 00045
> 00046
> 00047
> 00048
> 00049
> 00050this->__ERROR = __ERROR;
> 00051return 0;
> 00052}
> 00053void cleanup(void) {
> 00054__label_1:
> 00055
> 00056 double __DUMMY_1;
> 00057 __label_3:
> 00058
> 00059 double __DUMMY_3;
> 00060 __label_5:
> 00061
> 00062 double __DUMMY_5;
> 00063 __label_8:
> 00064
> 00065 double __DUMMY_8;
> 00066
> 00067Py_XDECREF(this->storage_V3);
> 00068 Py_XDECREF(this->storage_V5);
> 00069 Py_XDECREF(this->storage_V1);
> 00070}
> 00071int run(void) {
> 00072int __failure = 0;
> 00073
> 00074PyObject* py_V1;
> 00075
> 00076PyArrayObject* V1;
> 00077
> 00078typedef npy_float64 dtype_V1;
> 00079
> 00080PyObject* py_V3;
> 00081
> 00082PyArrayObject* V3;
> 00083
> 00084typedef npy_float64 dtype_V3;
> 00085
> 00086PyObject* py_V5;
> 00087
> 00088PyArrayObject* V5;
> 00089
> 00090typedef npy_float64 dtype_V5;
> 00091
> 00092 {
> 00093
> 00094py_V1 = Py_None;
> 00095{Py_XINCREF(py_V1);}
> 00096
> 00097V1 = NULL;
> 00098
> 00099 {
> 00100
> 00101py_V3 = PyList_GET_ITEM(storage_V3, 0);
> 00102{Py_XINCREF(py_V3);}
> 00103
> 00104V3 = NULL;
> 00105if (py_V3 == Py_None) {
> 00106// We can either fail here or set V3 to NULL and
> rely on Ops
> 00107// using tensors to handle the NULL case, but if
> they fail to do so
> 00108// they'll end up with nasty segfaults, so this is
> public service.
> 00109PyErr_SetString(PyExc_ValueError, "expected an
> ndarray, not None");
> 00110{
> 00111__failure = 4;
> 00112if (!PyErr_Occurred()) {
> 00113PyErr_SetString(PyExc_RuntimeError,
> 00114"Unexpected error in an Op's C code. "
> 00115"No Python exception was set.");
> 00116}
> 00117goto __label_4;}
> 00118}
> 00119if (!PyArray_Check(py_V3)) {
> 00120PyErr_SetString(PyExc_ValueError, "expected an
> ndarray");
> 00121{
> 00122__failure = 4;
> 00123if (!PyErr_Occurred()) {
> 00124PyErr_SetString(PyExc_RuntimeError,
> 00125"Unexpected error in an Op's C code. "
> 00126"No Python exception was set.");
> 00127}
> 00128goto __label_4;}
> 00129}
> 00130// We expect NPY_FLOAT64
> 00131if (!PyArray_ISALIGNED((PyArrayObject*) py_V3)) {
> 00132

[theano-users] import theano issues in PCharm community edition

2017-03-30 Thread Maradani Bhavana
Hello All,

I am using PyCharm IDE and anaconda (python 3.5.2). I have installed theano 
using conda. I tested with a small program in PyCharm as well as Spyder. 
The program runs well in spyder but gives issues in PyCharm IDE. I tried to 
install theano package in pyCharm IDE, but doesn't help. Below is the error 
which I get in pyCharm:


C:\Users\Bhavana\Anaconda3\python.exe 
C:/Users/Bhavana/PycharmProjects/untitled/1.py
===
1 #include 
2 #include 
3 #include "theano_mod_helper.h"
4 #include 
5 #include 
6 #include 
7 #include 
8 #include 
9 //
00010   Support Code
00011 //
00012 
00013namespace {
00014struct __struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707 {
00015PyObject* __ERROR;
00016 
00017PyObject* storage_V3;
00018 PyObject* storage_V5;
00019 PyObject* storage_V1;
00020
00021 
00022__struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707() {
00023// This is only somewhat safe because we:
00024//  1) Are not a virtual class
00025//  2) Do not use any virtual classes in the members
00026//  3) Deal with mostly POD and pointers
00027 
00028// If this changes, we would have to revise this, but for
00029// now I am tired of chasing segfaults because
00030// initialization code had an error and some pointer has
00031// a junk value.
00032memset(this, 0, sizeof(*this));
00033}
00034~__struct_compiled_op_mb7d4d181798f8e2bf5cb5c85493f6707(void) {
00035cleanup();
00036}
00037 
00038int init(PyObject* __ERROR, PyObject* storage_V3, PyObject* 
storage_V5, PyObject* storage_V1) {
00039Py_XINCREF(storage_V3);
00040 Py_XINCREF(storage_V5);
00041 Py_XINCREF(storage_V1);
00042this->storage_V3 = storage_V3;
00043 this->storage_V5 = storage_V5;
00044 this->storage_V1 = storage_V1;
00045
00046 
00047 
00048 
00049 
00050this->__ERROR = __ERROR;
00051return 0;
00052}
00053void cleanup(void) {
00054__label_1:
00055 
00056 double __DUMMY_1;
00057 __label_3:
00058 
00059 double __DUMMY_3;
00060 __label_5:
00061 
00062 double __DUMMY_5;
00063 __label_8:
00064 
00065 double __DUMMY_8;
00066 
00067Py_XDECREF(this->storage_V3);
00068 Py_XDECREF(this->storage_V5);
00069 Py_XDECREF(this->storage_V1);
00070}
00071int run(void) {
00072int __failure = 0;
00073
00074PyObject* py_V1;
00075
00076PyArrayObject* V1;
00077
00078typedef npy_float64 dtype_V1;
00079
00080PyObject* py_V3;
00081
00082PyArrayObject* V3;
00083
00084typedef npy_float64 dtype_V3;
00085
00086PyObject* py_V5;
00087
00088PyArrayObject* V5;
00089
00090typedef npy_float64 dtype_V5;
00091
00092 {
00093 
00094py_V1 = Py_None;
00095{Py_XINCREF(py_V1);}
00096
00097V1 = NULL;
00098
00099 {
00100 
00101py_V3 = PyList_GET_ITEM(storage_V3, 0);
00102{Py_XINCREF(py_V3);}
00103
00104V3 = NULL;
00105if (py_V3 == Py_None) {
00106// We can either fail here or set V3 to NULL and rely 
on Ops
00107// using tensors to handle the NULL case, but if they 
fail to do so
00108// they'll end up with nasty segfaults, so this is 
public service.
00109PyErr_SetString(PyExc_ValueError, "expected an 
ndarray, not None");
00110{
00111__failure = 4;
00112if (!PyErr_Occurred()) {
00113PyErr_SetString(PyExc_RuntimeError,
00114"Unexpected error in an Op's C code. "
00115"No Python exception was set.");
00116}
00117goto __label_4;}
00118}
00119if (!PyArray_Check(py_V3)) {
00120PyErr_SetString(PyExc_ValueError, "expected an 
ndarray");
00121{
00122__failure = 4;
00123if (!PyErr_Occurred()) {
00124PyErr_SetString(PyExc_RuntimeError,
00125"Unexpected error in an Op's C code. "
00126"No Python exception was set.");
00127}
00128goto __label_4;}
00129}
00130// We expect NPY_FLOAT64
00131if (!PyArray_ISALIGNED((PyArrayObject*) py_V3)) {
00132PyArrayObject * tmp = (PyArrayObject*) py_V3;
00133PyErr_Format(PyExc_NotImplementedError,
00134 "expected an aligned array of type %ld "
00135 "(NPY_FLOAT64), got non-aligned array of 
type %ld"
00136 " with %ld dimensions, with 3 last dims "
00137 "%ld, %ld,