lmjohns3/theanets

unexpected keyword argument 'rng' in graph.py

nkundiushuti opened this issue · 7 comments

I have seen that you've replaced nrng with rng. is it possible that it should have been replaced somewhere else in the framework?
I get this error in the create_dataset method of the graph.py because my dataset is a class which returns a callable.

When you call train or itertrain, are you passing nrng=... as a keyword argument? If so, just replace that with rng=....

I am not using this keyword argument. Maybe it's a climate error. As a temporary solution I commented the rng in the graph.py.

this is the code:

e = theanets.recurrent.Regressor(
        layers=(train.input_size, int(1.2*train.input_size), sepNets.lstm_layer(int(1.5*train.input_size)), int(1.8*train.input_size), train.output_size), 
        loss = 'SSEP', step = train.input_size, dist = 0,
        alpha=alpha,gamma=gamma,epsilon=epsilon,tau=tau,
    )

    e.train(
        train, 
        valid,
        algo='rmsprop',
        learning_rate=0.0001,
        momentum=0.9,
        max_gradient_clip=1,
        batch_size=batch_size,
        save_progress=pklnet, save_every=5,
    )

Can you copy the full traceback that you're getting?

sure..basically I did a more complex version of LargeDataset class you suggested. it was working perfectly before updating to the latest master

I 2015-08-24 20:59:26 test:339 found 70 files
I 2015-08-24 20:59:26 test:353 iteration size 7
I 2015-08-24 20:59:26 test:339 found 10 files
I 2015-08-24 20:59:26 test:353 iteration size 1
I 2015-08-24 20:59:26 theanets.layers.base:438 layer Input "in": 200 inputs
I 2015-08-24 20:59:26 theanets.layers.base:303 layer Feedforward "hid1": (in:out)200 -> 240, relu, 48240 parameters
I 2015-08-24 20:59:26 theanets.layers.base:303 layer LSTM "hid2": (hid1:out)240 -> 300, relu, 650100 parameters
I 2015-08-24 20:59:26 theanets.layers.base:303 layer Feedforward "hid3": (hid2:out)300 -> 360, relu, 108360 parameters
I 2015-08-24 20:59:26 theanets.layers.base:303 layer Feedforward "out": (hid3:out)360 -> 400, linear, 144400 parameters
I 2015-08-24 20:59:26 theanets.graph:110 network has 951100 total parameters
Traceback (most recent call last):
File "train_lstm.py", line 148, in
save_progress=pklnet, save_every=5,
File "/Volumes/Macintosh HD 2/Documents/git/phenicx-srcsep/neuralnets/rwc_cello/theanets/graph.py", line 346, in train
for monitors in self.itertrain(_args, *_kwargs):
File "/Volumes/Macintosh HD 2/Documents/git/phenicx-srcsep/neuralnets/rwc_cello/theanets/graph.py", line 286, in itertrain
valid = create_dataset(valid, name='valid', **kwargs)
File "/Volumes/Macintosh HD 2/Documents/git/phenicx-srcsep/neuralnets/rwc_cello/theanets/graph.py", line 279, in create_dataset
rng=kwargs.get('rng', None)
TypeError: init() got an unexpected keyword argument 'rng'

I wasn't on the latest version of downhill. this was the problem

Yes, I just got to the same conclusion. :)