Re: [theano-users] Compilation Error on Node

2018-05-24 Thread Pascal Lamblin

On 2018-05-24 06:47 AM, prakhar mishra wrote:

Keras on theano is giving this error. Help!


Which version of Theano are you using?
Also, this message does not specify the actual compilation error. Did 
you get this code from a file? Is there another part of the error 
message somewhere?


--
Pascal Lamblin

--

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Theano >= 1.0.1: Cannot not initialize GPU if already initialized in parent process

2018-05-24 Thread Arnaud Bergeron
Even if you use a different device, forking a process after the GPU has been 
initialized leads to all sorts of strange behaviour if you're not lucky.  This 
limitation comes from CUDA so it's not something we can fix.

We've added this check to make sure that people don't do this and from the 
number of reports we've seen lots of people were lucky in the past it seems.

The "proper" way to do this is to spawn the validation process before importing 
theano and communicating with it to tell it to validate.

Arnaud

(Also this is the proper channel for this type of question.)

> Le 24 mai 2018 à 06:24, Mathias Müller  a écrit :
> 
> Hi,
> 
> A recent commit concerning libgpuarray/ pygpu:
> 
> https://github.com/Theano/Theano/commit/073288a377d70f59962f81561251ec52304c07ab
> 
> creates a problem when using Nematus (a popular machine translation system 
> based on theano):
> 
> RuntimeError("You can't initialize the GPU in a subprocess if the parent 
> process already did it")
> 
> There is indeed a parent Python training process, and it spawns a child 
> Python process for validation. Training and validation need to be on 
> different devices, and this is realized with THEANO_FLAGS.
> 
> I investigated this issue a bit more, and it turns out this is not a problem 
> for Theano==1.0.0, only for Theano>=1.0.1.
> 
> Why is this change necessary?
> 
> Thanks and regards
> Mathias
> 
> P.S. I was not sure whether to open a Github issue or post here. If Github is 
> better please let me know.
> 
> -- 
> 
> --- 
> 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+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Compilation Error on Node

2018-05-24 Thread prakhar mishra
Keras on theano is giving this error. Help!


===
1#include 
2#include 
3#include "theano_mod_helper.h"
4#include 
5#include 
6#include 
7//
8  Support Code
9//
00010
00011namespace {
00012struct __struct_compiled_op_0040824c9d256009bbf96cfd9685133e {
00013PyObject* __ERROR;
00014
00015PyObject* storage_V3;
00016PyObject* storage_V5;
00017PyObject* storage_V7;
00018PyObject* storage_V9;
00019PyObject* storage_V1;
00020
00021
00022__struct_compiled_op_0040824c9d256009bbf96cfd9685133e() {
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_0040824c9d256009bbf96cfd9685133e(void) {
00035cleanup();
00036}
00037
00038int init(PyObject* __ERROR, PyObject* storage_V3, 
PyObject* storage_V5, PyObject* storage_V7, PyObject* storage_V9, PyObject* 
storage_V1) {
00039Py_XINCREF(storage_V3);
00040Py_XINCREF(storage_V5);
00041Py_XINCREF(storage_V7);
00042Py_XINCREF(storage_V9);
00043Py_XINCREF(storage_V1);
00044this->storage_V3 = storage_V3;
00045this->storage_V5 = storage_V5;
00046this->storage_V7 = storage_V7;
00047this->storage_V9 = storage_V9;
00048this->storage_V1 = storage_V1;
00049
00050
00051
00052
00053
00054
00055
00056this->__ERROR = __ERROR;
00057return 0;
00058}
00059void cleanup(void) {
00060__label_1:
00061
00062double __DUMMY_1;
00063__label_3:
00064
00065double __DUMMY_3;
00066__label_5:
00067
00068double __DUMMY_5;
00069__label_7:
00070
00071double __DUMMY_7;
00072__label_9:
00073
00074double __DUMMY_9;
00075__label_12:
00076
00077double __DUMMY_12;
00078
00079Py_XDECREF(this->storage_V3);
00080Py_XDECREF(this->storage_V5);
00081Py_XDECREF(this->storage_V7);
00082Py_XDECREF(this->storage_V9);
00083Py_XDECREF(this->storage_V1);
00084}
00085int run(void) {
00086int __failure = 0;
00087
00088PyObject* py_V1;
00089
00090PyArrayObject* V1;
00091
00092typedef npy_float32 dtype_V1;
00093
00094PyObject* py_V3;
00095
00096PyArrayObject* V3;
00097
00098typedef npy_float32 dtype_V3;
00099
00100PyObject* py_V5;
00101
00102PyArrayObject* V5;
00103
00104typedef npy_int16 dtype_V5;
00105
00106PyObject* py_V7;
00107
00108PyArrayObject* V7;
00109
00110typedef npy_int64 dtype_V7;
00111
00112PyObject* py_V9;
00113
00114PyArrayObject* V9;
00115
00116typedef npy_int64 dtype_V9;
00117
00118{
00119
00120py_V1 = PyList_GET_ITEM(storage_V1, 0);
00121{Py_XINCREF(py_V1);}
00122
00123if (py_V1 == Py_None)
00124{
00125
00126V1 = NULL;
00127
00128}
00129else
00130{
00131
00132V1 = NULL;
00133if (py_V1 == Py_None) {
00134// We can either fail here or set V1 to NULL and 
rely on Ops
00135// using tensors to handle the NULL case, but if 
they fail to do so
00136// they'll end up with nasty segfaults, so this is 
public service.
00137PyErr_SetString(PyExc_ValueError, "expected an 
ndarray, not None");
00138{
00139__failure = 2;
00140if (!PyErr_Occurred()) {
00141PyErr_SetString(PyExc_RuntimeError,
00142"Unexpected error in an Op's C code. "
00143"No Python exception was set.");
00144}
00145goto __label_2;}
00146}
00147if (!PyArray_Check(py_V1)) {
00148PyErr_SetString(PyExc

[theano-users] Theano >= 1.0.1: Cannot not initialize GPU if already initialized in parent process

2018-05-24 Thread Mathias Müller
Hi,

A recent commit concerning libgpuarray/ pygpu:

https://github.com/Theano/Theano/commit/073288a377d70f59962f81561251ec52304c07ab

creates a problem when using Nematus (a popular machine translation system 
based on theano):

RuntimeError("You can't initialize the GPU in a subprocess if the parent 
process already did it")

There is indeed a parent Python training process, and it spawns a child 
Python process for validation. Training and validation need to be on 
different devices, and this is realized with THEANO_FLAGS.

I investigated this issue a bit more, and it turns out this is not a 
problem for Theano==1.0.0, only for Theano>=1.0.1.

Why is this change necessary?

Thanks and regards
Mathias

P.S. I was not sure whether to open a Github issue or post here. If Github 
is better please let me know.

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.