clab / dynet

DyNet: The Dynamic Neural Network Toolkit
Apache License 2.0
3.42k stars 704 forks source link

RNN tutorial gives NotImplementedError #1356

Open YubinXie opened 6 years ago

YubinXie commented 6 years ago

Using the latest version (2.0.3) DyNet in Mac OS, both python3.6 and python2.7 give this error on cpu. Install today with 'pip install dynet' http://dynet.readthedocs.io/en/latest/tutorials_notebooks/RNNs.html

NotImplementedError Traceback (most recent call last)

in () 103 104 sentence = "a quick brown fox jumped over the lazy dog" --> 105 train(srnn, params_srnn, sentence) in train(rnn, params, sentence) 94 trainer = dy.SimpleSGDTrainer(pc) 95 for i in range(200): ---> 96 loss = do_one_sentence(rnn, params, sentence) 97 loss_value = loss.value() 98 loss.backward() in do_one_sentence(rnn, params, sentence) 54 s = s.add_input(lookup[char]) 55 #print(R.dim,s.output().dim) ---> 56 probs = dy.softmax(R*s.output() + bias) 57 loss.append( -dy.log(dy.pick(probs,next_char)) ) 58 loss = dy.esum(loss) _dynet.pyx in _dynet.Expression.__mul__() NotImplementedError:
YubinXie commented 6 years ago

Installation by python -m pip install git+https://github.com/clab/dynet#egg=dynet does not have this error in python3.5. On python3.6, after uninstall pip install dynet version, I tried to install dynet in that way, it gives me 'Symbol not found / Expected in: flat namespace' error. I am not sure if two installation version is messing up with each other, or it is a python3.6 problem.

YubinXie commented 6 years ago

A new py3.6 environment can work with installation of pip install gitxxx. So I guess it is a problem of 'pip install dynet'.

pmichel31415 commented 6 years ago

Thank you for bringing this to our attention. This is related to #1349 and will be solved as soon as there's a new release.