Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors with scan: got an unexpected keyword argument 'states' at tutorials/DT_RNN_Tut.py #51

Open
lionheartxlw opened this issue Mar 16, 2016 · 2 comments

Comments

@lionheartxlw
Copy link

I am using theano0.7. I got the following error from the tutorial.

TypeError: scan() got an unexpected keyword argument 'states'

Can anyone kindly help me? Thanks.

file: tutorials/DT_RNN_Tut.py
line: 235

scan for iterating the single-step sampling multiple times
[samples, summaries], updates = scan(sample_fn,
                  states = [
                      TT.alloc(numpy.int64(0), state['sample_steps']),
                      TT.alloc(numpy.float32(0), 1, eval(state['nhids'])[-1])],
                  n_steps= state['sample_steps'],
                  name='sampler_scan')
@nouiz
Copy link

nouiz commented Mar 19, 2016

This example used an old interface to scan. I'm not sure how to convert it.
@lamblin, do you remember?

On Wed, Mar 16, 2016 at 4:51 AM, lionheartxlw notifications@github.com
wrote:

I am using theano0.7. I got the following error from the tutorial.

TypeError: scan() got an unexpected keyword argument 'states'

Can anyone kindly help me? Thanks.

file: tutorials/DT_RNN_Tut.py
line: 235

scan for iterating the single-step sampling multiple times

[samples, summaries], updates = scan(sample_fn,
states = [
TT.alloc(numpy.int64(0), state['sample_steps']),
TT.alloc(numpy.float32(0), 1, eval(state['nhids'])[-1])],
n_steps= state['sample_steps'],
name='sampler_scan')


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#51

@lamblin
Copy link

lamblin commented Mar 29, 2016

You would need to use import scan from theano.scan_module instead of sandbox. Then use outputs_info instead of states, and the syntax is a bit different in that you only specify the initial state, instead of the whole buffer.
Then, you may need to keep only the requested number of steps you want to keep. For instance, for your second state (summaries), you will want to only keep summaries[-1].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants