Shapeworks: MacOSで「femur--groom_images」とクラッシュする

作成日 2021年03月25日  ·  23コメント  ·  ソース: SCIInstitute/ShapeWorks

$ python RunUseCase.py --use_case femur --groom_images

..。

#####センタリング

入力ファイル名:Output / femur / grayed / com_aligned / images / m03_L_1x_hip.isores.pad.com.nrrd
出力ファイル名:Output / femur / groomed / centered / images / m03_L_1x_hip.isores.pad.com.center.nrrd
入力ファイル名:Output / femur / groomed / com_aligned / images / m04_L_1x_hip.isores.pad.com.nrrd
....。
入力ファイル名:Output / femur / grayed / com_aligned / images / n19_L_1x_hip.isores.pad.com.nrrd
出力ファイル名:Output / femur / groomed / centered / images / n19_L_1x_hip.isores.pad.com.center.nrrd
入力ファイル名:Output / femur / groomed / com_aligned / images / n19_R_1x_hip.reflect.isores.pad.com.nrrd
出力ファイル名:Output / femur / groomed / centered / images / n19_R_1x_hip.reflect.isores.pad.com.center.nrrd
zsh:セグメンテーション違反python RunUseCase.py --use_case femur --groom_images

これは、RC10を搭載したMacOSでした。

QA bug

全てのコメント23件

tiny_testでクラッシュしますか?

tiny_testはクラッシュしません。

小さなテストでは大腿骨だけが残っているため、反射した大腿骨と関係がある可能性があります。

更新:再確認したところ、Linuxで動作するようです。

左大腿骨2本と右大腿骨1本でtiny_testを実行してみました。 そこに問題はありません。

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000016b8612ad libvnl_algo.dylib`vnl_qr<double>::vnl_qr(this=0x00007ffeefbfd568, M=0x00007ffeefbfd6f0) at vnl_qr.hxx:51:24 [opt]
    frame #1: 0x000000016b85cf1d libvnl_algo.dylib`double vnl_determinant<double>(M=<unavailable>, balance=<unavailable>) at vnl_determinant.hxx:107:14 [opt]
    frame #2: 0x00000003dec807ac _ITKIOImageBasePython.so`___lldb_unnamed_symbol9961$$_ITKIOImageBasePython.so + 252
    frame #3: 0x00000003deba7ff4 _ITKIOImageBasePython.so`___lldb_unnamed_symbol7056$$_ITKIOImageBasePython.so + 132
    frame #4: 0x00000003dec80586 _ITKIOImageBasePython.so`___lldb_unnamed_symbol9956$$_ITKIOImageBasePython.so + 38
    frame #5: 0x00000003dea1d188 _ITKIOImageBasePython.so`___lldb_unnamed_symbol1480$$_ITKIOImageBasePython.so + 1560
    frame #6: 0x00000003ded50753 _ITKIOImageBasePython.so`itk::ProcessObject::UpdateOutputInformation() + 351
    frame #7: 0x00000003dec7fec2 _ITKIOImageBasePython.so`___lldb_unnamed_symbol9945$$_ITKIOImageBasePython.so + 70
    frame #8: 0x00000003ded5b6f4 _ITKIOImageBasePython.so`itk::DataObject::Update() + 18
    frame #9: 0x000000041a65c177 _ITKCommonPython.so`___lldb_unnamed_symbol8759$$_ITKCommonPython.so + 58
    frame #10: 0x000000010002c843 python`_PyMethodDef_RawFastCallKeywords + 131
    frame #11: 0x000000010002c1d6 python`_PyObject_FastCallKeywords + 598
    frame #12: 0x0000000100164bb7 python`call_function + 455
    frame #13: 0x000000010015c604 python`_PyEval_EvalFrameDefault + 20180
    frame #14: 0x0000000100155f04 python`_PyEval_EvalCodeWithName + 532
    frame #15: 0x000000010002c5e3 python`_PyFunction_FastCallKeywords + 403
    frame #16: 0x0000000100164aa7 python`call_function + 183
    frame #17: 0x000000010015c604 python`_PyEval_EvalFrameDefault + 20180
    frame #18: 0x000000010002c535 python`_PyFunction_FastCallKeywords + 229
    frame #19: 0x0000000100164aa7 python`call_function + 183
    frame #20: 0x000000010015cdb0 python`_PyEval_EvalFrameDefault + 22144
    frame #21: 0x0000000100155f04 python`_PyEval_EvalCodeWithName + 532
    frame #22: 0x000000010002c5e3 python`_PyFunction_FastCallKeywords + 403
    frame #23: 0x0000000100164aa7 python`call_function + 183
    frame #24: 0x000000010015c604 python`_PyEval_EvalFrameDefault + 20180
    frame #25: 0x0000000100155f04 python`_PyEval_EvalCodeWithName + 532
    frame #26: 0x00000001001c1afb python`PyRun_FileExFlags + 235
    frame #27: 0x00000001001c14c6 python`PyRun_SimpleFileExFlags + 502
    frame #28: 0x00000001001ede30 python`pymain_run_file + 160
    frame #29: 0x00000001001ed72b python`pymain_run_filename + 123
    frame #30: 0x00000001001ecf11 python`pymain_run_python + 145
    frame #31: 0x00000001001ecb8b python`pymain_main + 27
    frame #32: 0x00000001000018c9 python`main + 89
    frame #33: 0x00007fff6aedfcc9 libdyld.dylib`start + 1
    frame #34: 0x00007fff6aedfcc9 libdyld.dylib`start + 1

これは#1168に関連している可能性がありますか?

ITKIOImageBasePython.soがこのスタックトレースに表示されるのはなぜですか? shapeworks pythonバインディング(Imageクラスなど)を使用していると思いましたか?

また、いくつかの警告lldbは、クラッシュする直前に吐き出されます。

2021-03-25 11:57:01.360622-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:01.360667-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.
2021-03-25 11:57:01.905525-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:01.905556-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.
2021-03-25 11:57:02.113545-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:02.113577-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.
2021-03-25 11:57:02.646500-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:02.646531-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.
2021-03-25 11:57:03.535838-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:03.535870-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.
2021-03-25 11:57:05.224328-0600 python[22532:5953417] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. N3itk10DataObjectE, N3itk5ImageIfLj3EEE.
2021-03-25 11:57:05.224362-0600 python[22532:5953417] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N3itk10DataObjectE, N3itk5ImageIfLj3EEE, N3itk9ImageBaseILj3EEE.

これは、左心房のユースケースのセンタリングステップでも発生していますか?

デバッグでもクラッシュしますか? より完全なスタックトレースが公開される可能性があります。 以来
画像はitk :: Imageを中心に構築されていますShapeWorksImage関数へのいくつかの呼び出し
単に最適化されるかもしれません。

はるか昔(ブランチはもう存在しないかもしれません)私は構築しようとしました
itkのPythonバインディングとbuild_dependenciesのitkですが、私はそうではありませんでした
成功。 特にconda / pipは
特に、すべてではありませんが、一部のitkpythonの異なるバージョンをインストールします
コンポーネント(5.0および5.1)、トラブルの露骨なレシピ。

2021年3月25日木曜日午前11時59分アランモリス@* >
書きました:

  • スレッド#1、キュー= 'com.apple.main-thread'、停止理由= EXC_BAD_ACCESS(コード= 1、アドレス= 0x0)

    • フレーム#0:0x000000016b8612ad libvnl_algo.dylib vnl_qr<double>::vnl_qr(this=0x00007ffeefbfd568, M=0x00007ffeefbfd6f0) at vnl_qr.hxx:51:24 [opt] frame #1: 0x000000016b85cf1d libvnl_algo.dylib double vnl_determinant(M =、バランス=)vnl_determinantで。 hxx:107 :14 [opt]

      フレーム#2:0x00000003dec807ac _ITKIOImageBasePython.so ___lldb_unnamed_symbol9961$$_ITKIOImageBasePython.so + 252 frame #3: 0x00000003deba7ff4 _ITKIOImageBasePython.so $$

      フレーム#4:0x00000003dec80586 _ITKIOImageBasePython.so ___lldb_unnamed_symbol9956$$_ITKIOImageBasePython.so + 38 frame #5: 0x00000003dea1d188 _ITKIOImageBasePython.so $$

      フレーム#6:0x00000003ded50753 _ITKIOImageBasePython.so itk::ProcessObject::UpdateOutputInformation() + 351 frame #7: 0x00000003dec7fec2 _ITKIOImageBasePython.so $$

      フレーム#8:0x00000003ded5b6f4 _ITKIOImageBasePython.so itk::DataObject::Update() + 18 frame #9: 0x000000041a65c177 _ITKCommonPython.so ___lldb_unnamed_symbol8759 $$ _ ITKCommonPython.so + 58

      フレーム#10:0x000000010002c843 python _PyMethodDef_RawFastCallKeywords + 131 frame #11: 0x000000010002c1d6 python _PyObject_FastCallKeywords + 598

      フレーム#12:0x0000000100164bb7 python call_function + 455 frame #13: 0x000000010015c604 python _PyEval_EvalFrameDefault + 20180

      フレーム#14:0x0000000100155f04 python _PyEval_EvalCodeWithName + 532 frame #15: 0x000000010002c5e3 python _PyFunction_FastCallKeywords + 403

      フレーム#16:0x0000000100164aa7 python call_function + 183 frame #17: 0x000000010015c604 python _PyEval_EvalFrameDefault + 20180

      フレーム#18:0x000000010002c535 python _PyFunction_FastCallKeywords + 229 frame #19: 0x0000000100164aa7 python call_function + 183

      フレーム#20:0x000000010015cdb0 python _PyEval_EvalFrameDefault + 22144 frame #21: 0x0000000100155f04 python _PyEval_EvalCodeWithName + 532

      フレーム#22:0x000000010002c5e3 python _PyFunction_FastCallKeywords + 403 frame #23: 0x0000000100164aa7 python call_function + 183

      フレーム#24:0x000000010015c604 python _PyEval_EvalFrameDefault + 20180 frame #25: 0x0000000100155f04 python _PyEval_EvalCodeWithName + 532

      フレーム#26:0x00000001001c1afb python PyRun_FileExFlags + 235 frame #27: 0x00000001001c14c6 python PyRun_SimpleFileExFlags + 502

      フレーム#28:0x00000001001ede30 python pymain_run_file + 160 frame #29: 0x00000001001ed72b python pymain_run_filename + 123

      フレーム#30:0x00000001001ecf11 python pymain_run_python + 145 frame #31: 0x00000001001ecb8b python pymain_main + 27

      フレーム#32:0x00000001000018c9 python main + 89 frame #33: 0x00007fff6aedfcc9 libdyld.dylib start + 1

      フレーム#34:0x00007fff6aedfcc9 libdyld.dylib`start + 1

これは#1168に関連している可能性があります
https://github.com/SCIInstitute/ShapeWorks/issues/1168


あなたが割り当てられたので、あなたはこれを受け取っています。
このメールに直接返信し、GitHubで表示してください
https://github.com/SCIInstitute/ShapeWorks/issues/1179#issuecomment-807193351
または購読を解除する
https://github.com/notifications/unsubscribe-auth/AAJT3EKCRFSERHDJ5XDPHCDTFN2ZPANCNFSM4ZZUXDBQ

アップデート。 わかりました。Pythonの出力に混乱しました。それ以上の出力がなかったため、まだ中央のステップにあると思いました。 FindReferenceImageでクラッシュしています:

    dim = itk.GetArrayFromImage(itk.imread(inDataList[i])).shape

私の推測では、問題は2つの異なるITKライブラリがメモリにロードされていることです。 👎

はるか昔(ブランチはもう存在しない可能性があります)、build_dependenciesでitkと一緒にitkのPythonバインディングをビルドしようとしましたが、成功しませんでした。 特に、conda / pipは、すべてではありませんが、一部のバージョンのitk pythonコンポーネント(5.0および5.1)をインストールしているため、問題を解決するための露骨なレシピです。

これでこの問題が解決する可能性があることに同意しますが、#1168についてはどうでしょうか。 次に、itkwidgetsを最初から作成し、それも提供して、ITKで作成する必要がありますか?

これでこの問題が解決する可能性があることに同意しますが、#1168についてはどうでしょうか。 次に、itkwidgetsを最初から作成し、それも提供して、ITKで作成する必要がありますか?

これが共有ライブラリの問題である場合は、ノートブックを実行する前にLD_LIBRARY_PATHを設定できる可能性があります。
更新:これを試しましたが、結果は同じでした
update2:私は#1168のユースケースのみを試しましたが、これは試しませんでした。

FindReferenceImageでクラッシュしています:

    dim = itk.GetArrayFromImage(itk.imread(inDataList[i])).shape

ShapeWorksはこの呼び出しには関与していません。 これをpdb実行することで、より多くの情報をクリーンアップできるのではないかと思います。
python -m pub RunUseCase.py --use_case femur --groom_images (次に「r」を押して実行します)

(私は今これを実行しています。クラッシュするのにどれくらい時間がかかりますか?誰かがこれを減らすことができましたか?)
更新:これには長い時間(約1時間)かかりますが、あまり役に立たないのは、セグメンテーション違反を報告するだけで、デバッガーにとどまることさえないということです。 外部スクリプトへの呼び出しが表示されないので、混乱しています。

問題は、Python ITKライブラリが、ビルドされたものではなく、VXLライブラリを解決して呼び出していることのようです。

  * frame #0: 0x000000016b8612ad libvnl_algo.dylib`vnl_qr<double>::vnl_qr(this=0x00007ffeefbfd568, M=0x00007ffeefbfd6f0) at vnl_qr.hxx:51:24 [opt]
    frame #1: 0x000000016b85cf1d libvnl_algo.dylib`double vnl_determinant<double>(M=<unavailable>, balance=<unavailable>) at vnl_determinant.hxx:107:14 [opt]
    frame #2: 0x00000003dec807ac _ITKIOImageBasePython.so`___lldb_unnamed_symbol9961$$_ITKIOImageBasePython.so + 252
    frame #3: 0x00000003deba7ff4 _ITKIOImageBasePython.so`___lldb_unnamed_symbol7056$$_ITKIOImageBasePython.so + 132

ITKではなく代替のVXL / VNLを使用してITKを構築していることを思い出してください。 libvnl_algo.dylibは私たちのもので、 _ITKIOImageBasePython.soはコンダからのものです。

さまざまなバージョンを混在させているため、クラッシュするのは当然のことです。

@archanasriと私は、インクルードの順序を逆にしようとしましたが(ここでも、#1168をテストします)、失敗します。
#1168の問題の解決策は、単純にitkwidgetsをビルドすることだと思います(現在、それを試しています)。
この問題のために、私たちは私たちにITKを指すことができますvnl我々はそれを指すようにeigen

すでにVXLを使用しているITKがあります。

-DITK_USE_SYSTEM_VXL=on -DVXL_DIR=${INSTALL_DIR}

アップデート。 わかりました。Pythonの出力に混乱しました。それ以上の出力がなかったため、まだ中央のステップにあると思いました。 FindReferenceImageでクラッシュしています:

    dim = itk.GetArrayFromImage(itk.imread(inDataList[i])).shape

私の推測では、問題は2つの異なるITKライブラリがメモリにロードされていることです。 👎

python itkを使用する代わりに、shapeworks.Image.toArray()を使用できます。 だから私は交換しました

dim = itk.GetArrayFromImage(itk.imread(inDataList[i])).shape

img = Image(inDataList[i])
tmp = img.toArray()
dim = tmp.shape

今はクラッシュしません。

素敵な@archanasri。 ええ、私たちはそれをそのように回避できると思いました。 基本的に、pythonitkとitkを同時に使用しないようにする必要があります。 itkwidgetsの問題は、ITK pythonインターフェイスを内部で使用していると想定しているため、より大きな問題だと思います。

ええ、私たちはitkwidgetsを構築することができません。
itkwidgetsがitkを使用する方法を見つける必要があります。

ええ、私たちはitkwidgetsを構築することができません。
itkwidgetsがitkを使用する方法を見つける必要があります。

itkwidgets 0.32.0(最新のタグ付きバージョン)setup.pyでは、次の要件を指定しています。

    'install_requires': [
        'colorcet>=2.0.0',
        'itk-core>=5.1.0.post2',
        'itk-filtering>=5.1.0.post2',
        'itk-meshtopolydata>=0.6.2',
        'ipydatawidgets>=4.0.1',
        'ipywidgets>=7.5.1',
        'ipympl>=0.4.1',
        'matplotlib',
        'numpy',
        'six',
        'zstandard',
    ],

itkの場合、これでPythonの構築に戻ることができると思います。
これにアプローチする別の方法は、これらがpip(ほとんど)とcondaによってインストールされたバージョンであることを確認することです。
私のシステム上のこれらすべてのバージョンはすべて新しいものです。

これが私が持っているものです:

(shapeworks) cam<strong i="15">@ananda</strong>:~/code/ShapeWorks/ShapeWorks/Examples/Python$ conda list | grep itk
itk                       5.0.1                    pypi_0    pypi
itk-core                  5.1.2                    pypi_0    pypi
itk-filtering             5.1.2                    pypi_0    pypi
itk-io                    5.0.1                    pypi_0    pypi
itk-meshtopolydata        0.6.3                    pypi_0    pypi
itk-numerics              5.1.2                    pypi_0    pypi
itk-registration          5.0.1                    pypi_0    pypi
itk-segmentation          5.0.1                    pypi_0    pypi
itkwidgets                0.32.0                   pypi_0    pypi
(shapeworks) cam<strong i="16">@ananda</strong>:~/code/ShapeWorks/ShapeWorks/Examples/Python$ conda list | grep ipy
brotlipy                  0.7.0           py37hf967b71_1001    conda-forge
ipycanvas                 0.8.2                    pypi_0    pypi
ipydatawidgets            4.2.0                    pypi_0    pypi
ipyevents                 0.8.2                    pypi_0    pypi
ipykernel                 5.5.0            py37he01cfaa_1    conda-forge
ipympl                    0.7.0                    pypi_0    pypi
ipython                   7.21.0           py37he01cfaa_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipyvtk-simple             0.1.4                    pypi_0    pypi
ipywidgets                7.6.3                    pypi_0    pypi

1つの危険信号は、itk-io、-registration、-segmentation、そして何よりもitk自体の5.0.1バージョンです。

pipインストールを最新に更新し(これを実行できなかった理由がいくつかありましたが、今のところそれは脇に置いておきます)、すべての依存関係を再構築しました。 #1168は、そこに記載されているのと同じ方法でクラッシュします。

修理済み。

このページは役に立ちましたか?
0 / 5 - 0 評価