dennybritz / rnn-tutorial-rnnlm

Recurrent Neural Network Tutorial, Part 2 - Implementing a RNN in Python and Theano
Apache License 2.0
895 stars 468 forks source link

error:scan() got an unexpected keyword argument 'strict' #1

Open carrierlxk opened 8 years ago

carrierlxk commented 8 years ago

When I run the 'RNNTheano' in ipython file: RNNLM, an error emerges: TypeError Traceback (most recent call last)

in () 2 # To avoid performing millions of expensive calculations we use a smaller vocabulary size for checking. 3 grad_check_vocab_size = 5 ----> 4 model = RNNTheano(grad_check_vocab_size, 10) 5 gradient_check_theano(model, [0,1,2,3], [1,2,3,4]) /home/carrierlxk/rnn-tutorial-rnnlm-master/rnn_theano.py in **init**(self, word_dim, hidden_dim, bptt_truncate) 22 # We store the Theano graph here 23 self.theano = {} ---> 24 self.**theano_build**() 25 26 def **theano_build**(self): /home/carrierlxk/rnn-tutorial-rnnlm-master/rnn_theano.py in **theano_build**(self) 38 non_sequences=[U, V, W], 39 truncate_gradient=self.bptt_truncate, ---> 40 strict=True) 41 42 prediction = T.argmax(o, axis=1) TypeError: scan() got an unexpected keyword argument 'strict' What is the reason?
dennybritz commented 8 years ago

Hm, I haven't run into this. According to the Tehano doc [1] then scan function has a strict argument. Are you maybe using an old version of Theano?

[1] http://deeplearning.net/software/theano/library/scan.html

carrierlxk commented 8 years ago

Hi, I have checked my theano version, it is version 0.6.0 NumPy version 1.9.0 Python version 2.7.8 |Anaconda 2.1.0 nose version 1.3.4

dennybritz commented 8 years ago

The requirements.txt file lists Theano version 0.7.0, maybe try upgrading?