You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First and foremost, THANK YOU for this AWESOME LSTM lib!!
I am new to all of these, RNN, Theano, and even Python, so please forgive my ignorant question:
I download the Tutorial.ipynb, and run it line by line, however it stuck at:
# construct model & theano functions:model=Model(
input_size=10,
hidden_size=10,
vocab_size=len(vocab),
stack_size=1, # make this bigger, but makes compilation slowcelltype=RNN# use RNN or LSTM
)
model.stop_on(vocab.word2index["."])
where the error message is:
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
<ipython-input-10-13e620ce56bd>in<module>()
5vocab_size=len(vocab),
6stack_size=1, # make this bigger, but makes compilation slow---->7celltype=RNN# use RNN or LSTM8 )
9model.stop_on(vocab.word2index["."])
<ipython-input-8-398b63091e52>in__init__(self, hidden_size, input_size, vocab_size, stack_size, celltype)
62self.srng=T.shared_randomstreams.RandomStreams(np.random.randint(0, 1024))
63# create symbolic variables for prediction:--->64self.predictions=self.create_prediction()
65# create symbolic variable for greedy search:66self.greedy_predictions=self.create_prediction(greedy=True)
<ipython-input-8-398b63091e52>increate_prediction(self, greedy)
107outputs_info=outputs_info)
108else:
-->109outputs_info= [initial_state_with_taps(layer, num_examples) forlayerinself.model.layers[1:]]
110result, _=theano.scan(fn=step,
111sequences=[inputs.T],
<ipython-input-8-398b63091e52>ininitial_state_with_taps(layer, dimensions)
34definitial_state_with_taps(layer, dimensions=None):
35"""Optionally wrap tensor variable into a dict with taps=[-1]"""--->36state=initial_state(layer, dimensions)
37ifstateisnotNone:
38returndict(initial=state, taps=[-1])
<ipython-input-8-398b63091e52>ininitial_state(layer, dimensions)
30returnlayer.initial_hidden_stateifhas_hidden(layer) elseNone31else:
--->32returnmatrixify(layer.initial_hidden_state, dimensions) ifhas_hidden(layer) elseNone3334definitial_state_with_taps(layer, dimensions=None):
<ipython-input-8-398b63091e52>inmatrixify(vector, n)
1819defmatrixify(vector, n):
--->20returnT.repeat(T.shape_padleft(vector), n, axis=0)
2122definitial_state(layer, dimensions=None):
C:\Anaconda\lib\site-packages\theano\tensor\extra_ops.pycinrepeat(x, repeats, axis)
358 .. versionadded:: 0.6359"""--> 360 return RepeatOp(axis=axis)(x, repeats) 361 362 C:\Anaconda\lib\site-packages\theano\gof\op.pyc in __call__(self, *inputs, **kwargs) 397 """398return_list=kwargs.pop('return_list', False)
-->399node=self.make_node(*inputs, **kwargs)
400ifself.add_stack_trace_on_call:
401self.add_tag_trace(node)
C:\Anaconda\lib\site-packages\theano\tensor\extra_ops.pycinmake_node(self, x, repeats)
257 ("dtypes %s are not supported by numpy.repeat "258"for the 'repeats' parameter, "-->259%numpy_unsupported_dtypes), repeats.dtype)
260261ifself.axisisNone:
TypeError: notallargumentsconvertedduringstringformatting
EDIT 1:
In the beginning, I thought maybe my Theano 0.6.0 is a bit old, so I update it to 0.7.0, but the error remains.
EDIT 2:
I fixed the syntax typo and got the real error message:
TypeError: ("dtypes ('uint32', 'int64', 'uint64') are not supported by numpy.repeat for the 'repeats' parameter, ", 'int64')
EDIT4
Just found out the new errors are similar to issue12, which mentioned the error have something to do with scipy. So update it
scipy: 0.15.1-np19py27_0 --> 0.16.0-np19py27_0
Run the example code again, and the error remains. Still stuck. Frustrating.
These bugs are really newbie unfriendly, Last time I use pandas and got stuck with some pytable bugs, spend way too much time trying to develop walk-around. I don't want to spend time fighting the tools, I just want to get them up and running FAST so I can do my actual work.
The text was updated successfully, but these errors were encountered:
ewan1983
changed the title
Problem running the example code
Problem running the example code in 32-bit OS
Jul 28, 2015
First and foremost, THANK YOU for this AWESOME LSTM lib!!
I am new to all of these, RNN, Theano, and even Python, so please forgive my ignorant question:
I download the Tutorial.ipynb, and run it line by line, however it stuck at:
where the error message is:
EDIT 1:
In the beginning, I thought maybe my Theano 0.6.0 is a bit old, so I update it to 0.7.0, but the error remains.
EDIT 2:
I fixed the syntax typo and got the real error message:
And then I notice:
It is because I use 32 bit OS, the somehow default int64 type is not supported,
So you guys with 64 bit OS shouldn't have experienced this problem.
EDIT 3:
So I tried to force cast the type to get over this error:
Then I just got blown over by a huge load of error and warnings
EDIT4
Just found out the new errors are similar to issue12, which mentioned the error have something to do with scipy. So update it
scipy: 0.15.1-np19py27_0 --> 0.16.0-np19py27_0
Run the example code again, and the error remains. Still stuck. Frustrating.
These bugs are really newbie unfriendly, Last time I use pandas and got stuck with some pytable bugs, spend way too much time trying to develop walk-around. I don't want to spend time fighting the tools, I just want to get them up and running FAST so I can do my actual work.
The text was updated successfully, but these errors were encountered: