soroushmehr / sampleRNN_ICLR2017

SampleRNN: An Unconditional End-to-End Neural Audio Generation Model

Home Page:https://arxiv.org/abs/1612.07837

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run on CPU (vs GPU)

LinkOne1A opened this issue · comments

Although I can run on the GPU, I like to play around on smaller files on CPU, but I can't figure out why i get this theano error, and wondering if someone might know or direct me to the next step in invetsigation.

Anyhow, in a theano docker, running a training I don't get much far due to this error:

File "./models/two_tier/two_tier.py", line 394, in <module>
    prev_samples = T.nnet.neighbours.images2neibs(prev_samples, (1, FRAME_SIZE), neib_step=(1, 1), mode='valid')
AttributeError: 'module' object has no attribute 'neighbours'

I beleive I have all the pre req's installed, latest theano, etc:

Python:
	sys.version_info	sys.version_info(major=2, minor=7, micro=6, releaselevel='final', serial=0)
Numpy:
	.__version__	1.8.2
Theano:
	.__version__	0.9.0dev5.dev-598991d76d2764ab7411c5dc5a2dcc59e3ef55ea

And, in python i can see module nnet DOES have neighbours:

python:
import theano
help(theano.tensor.nnet)

Help on package theano.tensor.nnet in theano.tensor:
NAME
    theano.tensor.nnet
FILE
    /usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/__init__.py
PACKAGE CONTENTS
    Conv3D
    ConvGrad3D
    ConvTransp3D
    abstract_conv
    blocksparse
    bn
    conv
    conv3d2d
    corr
    corr3d
    neighbours
    nnet
    opt
    sigm
    tests (package)

Thoughts?

I figured out the solution.

I don't understand why this is working for the GPU run, but for the CPU run to work, two_tiers.py needs to have a line that imports the neighbours module.

So, add a line to top of the two_tiers.py file:
import theano.tensor.nnet.neighbours

Might be an issue for the other models, but I've been only playing with two_tiers, so my comments are only verified w.r.t to this model.