track_memory.py: TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Bug #715114 reported by Dieter P
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Meliae
Incomplete
Medium
Unassigned

Bug Description

* Python 2.7.1
* Meliae 0.3.0

For completeness, I'll show the complete run, including output of the command I'm testing:

$ track_memory.py ./build-models.py
spawning: ['./build-models.py']
Building sorted file list for doc_*
build_file_list doc/min: 1698076.950773
Building dictionary and corpus
 120.451s 286.8MB 286.8MB 30398.8MB*s
 243.904s 420.5MB 420.5MB 74471.0MB*s
 554.136s 1034.7Dictionary(125732 unique tokens)
build_dict_corpus doc/min: 19094.502591
INFO:utils:saving Dictionary object to doc__dic
Building Tf-Idf for corpus
build_tfidf doc/min: 3656978.134640
INFO:utils:saving TfidfModel object to doc__tfidf
Building term-document matrix for corpus
 614.389s 1303.5MB 1303.5MB 354046.0MB*sbuild_matrix doc/min: 248713.277764
INFO:utils:saving SparseMatrixSimilarity object to doc__sparseSM
Loading file list
Loading dictionary
INFO:utils:loading Dictionary object from doc__dic
Loading corpus
Loading corpus_map
Loading SMS
INFO:utils:loading SparseMatrixSimilarity object from doc__sparseSM
Loading Tf-Idf object
INFO:utils:loading TfidfModel object from doc__tfidf
Removing previous similarityfile
Calculating similarities
Getting similarities against data/doc_131669
rebuild_topsimilarities doc/min: 39.520561
==== INFO ===
               token tokenId idf docFreq
        opdringerige 17275 14.449995 28
            syndroom 30883 12.057678 60
                 3,5 76557 11.183208 81
              pecrot 35890 10.926433 88
       herinneringen 75018 10.708528 95
          maastricht 81207 10.495799 103
              stress 111079 10.472715 103
           treinramp 107660 10.405601 106
               kampt 121587 9.998784 123
             meesten 4251 8.865032 188
               kwart 55373 8.592014 209
                last 65072 8.400146 226
            klachten 65705 8.338859 231
            ongeveer 13382 8.178532 247
            getuigen 91325 8.146214 250
        universiteit 92888 7.883941 278
               later 75758 6.519997 500
              blijkt 67663 6.203254 578
             vrouwen 8274 6.186139 583
              mannen 82636 6.116281 602
             maanden 36783 5.968196 645
           onderzoek 95881 5.496526 810
                 dan 41439 3.640126 2213
                meer 6900 3.448235 2489
              hebben 123483 3.170167 2968
              hebben 123483 3.170167 2968
                 uit 111793 2.736018 3970
                 dat 81014 2.141620 6159
The following tokens are skipped. they are probably stopwords or words which only occur once:
['een', 'van', 'de', 'van', 'de', 'in', 'met', 'het', 'posttraumatisch', 'een', 'van', 'de', 'van', 'de', 'van']
Traceback (most recent call last):.4MB*s
  File "/usr/bin/meliae-track_memory.py", line 66, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/meliae-track_memory.py", line 61, in main
    spawn_and_track(opts, args)
  File "/usr/bin/meliae-track_memory.py", line 47, in spawn_and_track
    cur_mem*mb, peak_mem*mb, mem_secs*mb)
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 715114] [NEW] track_memory.py: TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

...

> File "/usr/bin/meliae-track_memory.py", line 47, in spawn_and_track
> cur_mem*mb, peak_mem*mb, mem_secs*mb)
> TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

It looks like something in there was still 'None', which is a bit
surprising. I wish it was easier to detect which variable it was.

I wonder if something exited early, or maybe on your system I'm not
detecting one of the strings correctly.

 status: incomplete
 importance: medium

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1uZ18ACgkQJdeBCYSNAAPHWgCeJ8RftzLREFgo3iTYy0i1NxKZ
0fMAoMw7m+qDaRmHbdn/KpJr91nWR8of
=ZgMC
-----END PGP SIGNATURE-----

Changed in meliae:
importance: Undecided → Medium
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.