error: deallocating None

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

error: deallocating None

WingIDE - User mailing list

I’m running a pretty big python job on my laptop which performs IBM Model 1 word alignment on 200 French/English sentence pairs, and it goes through about 1600 iterations of the Expectation Maximization (EM), then dies with the following error:

 

 

Fatal Python error: deallocating None

 

Current thread 0x000014e8 (most recent call first):

  File "c:\Users\Jeff\Data\path\ibm1-align", line 110 in <module>

  File "C:\src\ide\bin\3.4\src/debug/tserver\dbgserver.pyc", line 3095 in __RunFileInMain

  File "C:\src\ide\bin\3.4\src/debug/tserver\dbgserver.pyc", line 786 in RunFile

  File "C:\src\ide\bin\3.4\src/debug/tserver\netserver.pyc", line 971 in Run

  File "C:\Program Files (x86)\Wing IDE 5.1\bin\wingdb.py", line 662 in DebugFile

  File "C:\Program Files (x86)\Wing IDE 5.1\bin\wingdb.py", line 814 in main

  File "C:\Program Files (x86)\Wing IDE 5.1\bin\wingdb.py", line 874 in <module>

 

 

I don’t even know what “deallocating None” means. It’s not an error which breaks into the debugger so that I can examine variables; it just dies. The line where it fails (110) is the innermost part of this loop:

 

                for f in f_words:

                                for e in e_words:

                                                t_ef[(e, f)] = count_ef[(e, f)] / total_f[f]

 

The dictionary t_ef is defined as a collections.defaultdict as follows:

 

t_ef = defaultdict(lambda: 1/len(f_words))

 

But by the first iteration of the EM all of the dictionary entries should be present, since f_words and e_words are fixed lists, so we couldn’t be creating a new default value when it dies. Furthermore the values of total_f are calculated in the same loop as count_ef, so total_f[f] >= count_ef[(e, f)], and I don’t think it could ever be zero, but even if it was, I would expect a divide by zero error.

 

So does anyone have any idea why I’m getting this error, and what I might be able to do about it?

 

Thanks,

Jeff


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: error: deallocating None

WingIDE - User mailing list
On 1/22/16 8:41 AM, Jeff Heath via wingide-users wrote:
> I’m running a pretty big python job on my laptop which performs IBM
> Model 1 word alignment on 200 French/English sentence pairs, and it goes
> through about 1600 iterations of the Expectation Maximization (EM), then
> dies with the following error:

This indicates a bug with C extension code and you may need to use a C
debugger to look into it.  Does this occur when running the code outside
of Wing's debugger?

Thanks,

John

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide