Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

Python debugger tells me value of Numpy array is "*** Newest frame"

What does this mean?

My function gets two numpy arrays from a python/c library. After that function call I turn on the debugger to find a bug, so I add the line to look at the two numpy arrays.

    import pdb; pdb.set_trace()

But for the values of one of the arrays pdb only returns the message *** Newest frame

PDB output:

(Pdb) type(d)
<type 'numpy.ndarray'>
(Pdb) type(f)
<type 'numpy.ndarray'>
(Pdb) f.shape
(3, 3, 17856)
(Pdb) d[0].shape
*** Newest frame
(Pdb) d[0]
*** Newest frame
question from:https://stackoverflow.com/questions/15160946/python-debugger-tells-me-value-of-numpy-array-is-newest-frame

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The command d is the command for the debugger used to go down the stack to a 'newer frame'. It seems that the parsing cannot not handle this disambiguity.

Try renaming the variable d.

EDIT: Actually, the comments suggest much better handling than renaming.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...