だから私はfoo
普通のフロートの普通のタプルを持っています。私のスクリプトで map を呼び出すと、コードに問題はありませんが、不可解にすべての Numpy エラーがスローされます。デバッガーに入ってまったく同じコードを実行しても、予想どおりエラーは発生しません。何が起こっているのか誰にも分かりませんか?私は完全に途方に暮れています。これはどのように可能ですか?
また、問題を再現するための最小限のスクリプトを求めている方へ: 短いスニペットを使用して再現することはできません。また、宿題のため、スクリプト全体を投稿することもできません。
Traceback (most recent call last):
File "py_code\ps4-code.py", line 240, in <module>
doPairMatch(transA, transB, tapoints, tbpoints, 1, ransacTranslate)
File "py_code\ps4-code.py", line 217, in doPairMatch
print map(int, foo)
TypeError: expected a single-segment buffer object
>>> import pdb;pdb.pm()
> c:\homework\cs4495\ps4\py_code\ps4-code.py(217)doPairMatch()
-> print map(int, foo)
(Pdb) print foo
(603.0, 437.0)
(Pdb) print map(int, foo)
[603, 437]
(Pdb) print type(foo)
<type 'tuple'>
(Pdb) print int, map, type
<type 'int'> <built-in function map> <type 'type'>
(Pdb) map(type, foo)
[<type 'float'>, <type 'float'>]
(Pdb)
編集:少なくとも、これがどのように可能かを理解しました。この問題はガベージ コレクション中に発生しているようです。そのため、コードの無関係な部分にエラーがランダムに表示されていました。おそらく、gc が OpenCV のどこかでバグを引き起こし、すべてをクラッシュさせています。
Exception TypeError: 'expected a single-segment buffer object' in 'garbage colle
ction' ignored
Fatal Python error: unexpected exception during garbage collection
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.