IndicoDataSolutions / Passage

A little library for text analysis with RNNs.
MIT License
530 stars 134 forks source link

a run-time error:not all arguments converted during string formatting #2

Closed bighaidao closed 9 years ago

bighaidao commented 9 years ago

hi , I hava a error in code Passage-master\passage\layers.py", line 209, in output outputs_info=[repeat(self.h0, x_h.shape[1], axis=0)],

the error info is TypeError: not all arguments converted during string formatting

how can i fix it ?thanks

Newmu commented 9 years ago

Could you post a more details so we can try and replicate it on our end?

This is getting into the internals so it's difficult to know what's causing this, but x_h is related to the input to a model.fit call so it could be incorrect input - did you tokenize your data?

Thanks!

bighaidao commented 9 years ago

thanks for you reply。 i download the data in you code--blogger_data_2.csv the environment is windows7 64 and Anaconda .

the all error info is

['So im back from Arizona now and its 11 but it feels like 9 to me, so im not too tired. Cait went home a few hours ago and im alone for the first time in...a while. which is good and bad. Caitlin and i had some fun adventures with the creepy bugs and the trip to the observatory and the fireworks and the george forman grill and the many many moives and bond wars and... i dunno. fun stuff. I like Caitlin. She\'s a cool kid. But its been a while since i felt so much like i had a best friend...and i wasn\'t with her. if that makes any sense. which it might not. and i dont mean that i wasnt having fun with caitlin, cause i definitely was. but... i dunno, certain things... its....really hard to explain. i dont just mean that i was missing emily. i mean...i would just feel sometimes that, although i love Caitlin and we\'re close friends, its not the same. Wow, tahts a horrible explanation. sorry. suffice to say it hammered in the notion that Emily is my best friend. I don\'t/didn\'t like to think about her that way... cause... im not her best friend. im one of her best friends. so shes just...Emily. And that means a hell of a lot of things as opposed to "best friend" which only means one...so its a more suitible title, right? I dunno. but anyone who knows me well will understand... i have an Emily. are we best friends? well, lets not bother with all that. she\'s Emily. \'nuff said. and i used to think about it like that all the time. not that i would ever call you a liar if you said she was my best friend, but i...didnt like to htink about it like that. i guess. i dunno. But this trip... i dunno, it seems so much more apparent that i have a best friend. maybe Emily doesnt have a best friend, but i do. and... i dunno, it just seems easier to think about our friendship now in comparison to my friendships with other people...like...now its not so weird to say best friend, whearas before...well, she kind of had her own category or something. and i guess she still does. im not gonna go shouting to all the world "Emily\'s my best friend!" but... i dunno. just...somehow... im thinking about it differently now. aaaaaaaaand... i was good until Tuesday. but i dont really want to talk about that here. i dunno what to say about my trip. my brothers annoyed me. a lot. i really dont want to go to fencing. i really want to see Emily tommorrow or wednesday and get on with our crazy fun summer. cant wait to go to church. ;-) I love Caitlin in such a different way than i love Emily. Or anyone, for that matter. I dont think you really love people more or less than other people...just...differently. but there can be quite a difference. I love looking up at the stars. I should really get to that poem... I hope she comes next summer.'] ['UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK UNK'] 3 Traceback (most recent call last): File "E:/code/pyhton/ml/NLP/Passage-master/tutorial.py", line 40, in model = RNN(layers=layers, cost='bce') #bce is classification loss for binary classification and sigmoid output File "E:\code\pyhton\ml\NLP\Passage-master\passage\model.py", line 38, in init self.y_tr = self.layers[-1].output(dropout_active=True) File "E:\code\pyhton\ml\NLP\Passage-master\passage\layers.py", line 238, in output X = self.l_in.output(dropout_active=dropout_active) File "E:\code\pyhton\ml\NLP\Passage-master\passage\layers.py", line 209, in output outputs_info=[repeat(self.h0, x_h.shape[1], axis=0)], File "E:\Program Files\Anaconda\lib\site-packages\theano\tensor\extra_ops.py", line 360, in repeat return RepeatOp(axis=axis)(x, repeats) File "E:\Program Files\Anaconda\lib\site-packages\theano\gof\op.py", line 399, in call node = self.make_node(_inputs, *_kwargs) File "E:\Program Files\Anaconda\lib\site-packages\theano\tensor\extra_ops.py", line 259, in make_node % numpy_unsupported_dtypes), repeats.dtype) TypeError: not all arguments converted during string formatting

Process finished with exit code 1

Newmu commented 9 years ago

Something is wrong with the tokenizer in this example. How are you calling/using it? This behavior might happen with a list containing only one string.

bighaidao commented 9 years ago

just as the code tutorial.py . and the data download from https://s3-us-west-1.amazonaws.com/nextml/blogger_data_2.csv.tar.gz

Slater-Victoroff commented 9 years ago

@bighaidao Having some trouble reproducing this. Could you provide some details about the system that you're on? A pip freeze dump and a quick description of your system (OS, package manager, etc...) should be enough to dig into this a little more in-depth.

Slater-Victoroff commented 9 years ago

Going to go ahead and close this one as we've been unable to reproduce the error and bighaido hasn't provided any more details.