lmjohns3/theanets

python and ipython crashes when running examples on Win 8 x64

fordanic opened this issue · 6 comments

When running theanets examples such as mnist-classifyer.py or xor-classifyer.py, either using python or ipython it will run until
'I 2015-10-15 16:08:59 downhill.base:124 compiling RMSProp function'
and then crash.

When running from spyder I get the additional output of
'It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console'

Same thing happens when I build my own networks.

Running on windows 8, x64 with Anaconda using python 3.4.3 (x64).

Basic examples for theano seems to be working and theanets installed by downloading source and installing directly.

Suggestions, ideas? Anything apart from changing to another OS?

This might unfortunately be OS-related.

But before coming to that conclusion, is there any information given when the program crashes? Segmentation fault?

Yeah, I'm suspecting that it's OS related as well.

Unfortunately, no further info is given. As noted in the previous post, the only thing I know it that it happens during the compilation of the RMSProp function and that in spyder ipython says that the kernel died unexpectedly.

When running from the command line, python xor-classifyer.py, I'm given the option to debug but nothing shows up in VS2013.

Any suggestions for what I could try to do?

It sounds to me like you'd need to get your hands on a Python that's been compiled with debugging information? But I'm not at all experienced using the VS toolchain, so I won't be much help. :(

One thing that you could try is to use a learning algorithm other than rmsprop (try algo='sgd' for example during training) ... if you get the same behavior then something in your cuda or numpy or theano installs might be weird. If not then some feature of rmsprop's graph optimization/compilation process is at fault.

Changed to algo='sgd' for xor-classifier.py which didn't get me any further, i.e. it crashes once get to compiling the SGD function.

I guess I'll try to see if I can run some other theano examples to see if I can provoke something there.

When you say cuda, is that a requirement? I thought a GPU and cuda was optional for theano and correspondingly for theanets.

Hmh, it seems to be something with theano.

Running this example for their tutorial crashes python
import theano
import theano.tensor as T
import numpy as np
floatX = "float32"

X = T.matrix("X")
W = T.matrix("W")
b_sym = T.vector("b_sym")

results, updates = theano.scan(lambda v: T.tanh(T.dot(v, W) + b_sym), sequences=X)
compute_elementwise = theano.function(inputs=[X, W, b_sym], outputs=[results],on_unused_input='ignore')

x = np.eye(2, dtype=theano.config.floatX)
w = np.ones((2, 2), dtype=theano.config.floatX)
b = np.ones((2), dtype=theano.config.floatX)
b[1] = 2

print(compute_elementwise(x, w, b)[0])

print(np.tanh(x.dot(w) + b))

But if I remove b_sym from
results, updates = theano.scan(lambda v: T.tanh(T.dot(v, W) + b_sym), sequences=X)
i.e.
results, updates = theano.scan(lambda v: T.tanh(T.dot(v, W)), sequences=X)
Then it works.????

So, close this issue and I'll see if I can do something about my theano installation.

OK, sorry I couldn't be more help, but it does sound like a Theano/environment issue more than a theanets one. :(

About Cuda: you're correct that it's optional, I just thought you might be using it and that would provide an extra source of potential problems to crop up.