Shapeworks: 在 MacOS 上使用“femur --groom_images”崩溃

创建于 2021-03-25  ·  23评论  ·  资料来源: SCIInstitute/ShapeWorks

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

...

##### 居中

输入文件名:Output/femur/groomed/com_aligned/images/m03_L_1x_hip.isores.pad.com.nrrd
输出文件名:输出/股骨/修饰/中心/图像/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/groomed/com_aligned/images/n19_L_1x_hip.isores.pad.com.nrrd
输出文件名:输出/股骨/修饰/中心/图像/n19_L_1x_hip.isores.pad.com.center.nrrd
输入文件名:Output/femur/groomed/com_aligned/images/n19_R_1x_hip.reflect.isores.pad.com.nrrd
输出文件名:输出/股骨/修饰/中心/图像/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 构建的,一些对 ShapeWorks Image 函数的调用
可能只是优化了。

很久以前很远(分支可能不再存在)我试图建立
itk 的 Python 绑定以及 build_dependencies 中的 itk,但我没有
成功的。 我怀疑值得再试一次,尤其是因为 conda/pip 是
尤其是安装一些(但不是全部)itk python 的不同版本
组件(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双 vnl_determinant(M=, 余额=) 在 vnl_determinant。 hxx:107 :14 [选择]

      帧 #2:0x00000003dec807ac _ITKIOImageBasePython.so ___lldb_unnamed_symbol9961$$_ITKIOImageBasePython.so + 252 frame #3: 0x00000003deba7ff4 _ITKIOImageBasePython.so ___lldb_unnamed_symbol7056$$_ITKIOImageBasePython.so + 132

      第 4 帧:0x00000003dec80586 _ITKIOImageBasePython.so ___lldb_unnamed_symbol9956$$_ITKIOImageBasePython.so + 38 frame #5: 0x00000003dea1d188 _ITKIOImageBasePython.so ___lldb_unnamed_symbol1480$$_ITKIOImageBasePython.so + 1560

      第 6 帧:0x00000003ded50753 _ITKIOImageBasePython.so itk::ProcessObject::UpdateOutputInformation() + 351 frame #7: 0x00000003dec7fec2 _ITKIOImageBasePython.so ___lldb_unnamed_symbol9945$$_ITKIOImageBasePython.so + 70

      帧 #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 蟒蛇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

我的猜测是问题在于我们在内存中加载了两个不同的 ITK 库。 👎

很久以前(分支可能不再存在)我试图在 build_dependencies 中与 itk 一起构建 itk 的 Python 绑定,但我没有成功。 我怀疑它值得再试一次,特别是因为 conda/pip 特别安装了一些(但不是全部)itk python 组件(5.0 和 5.1)的不同版本,这是一个公然的麻烦秘诀。

我同意这可能会解决这个问题,但是 #1168 呢。 那么我们是否需要从头开始构建 itkwidgets 并提供它,以便它使用我们的 ITK 构建?

我同意这可能会解决这个问题,但是 #1168 呢。 那么我们是否需要从头开始构建 itkwidgets 并提供它,以便它使用我们的 ITK 构建?

如果这是共享库问题,也许我们可以在运行笔记本之前设置 LD_LIBRARY_PATH。
更新:我试过了,结果是一样的
更新 2:我只尝试了 #1168 用例,而不是这个用例。

它在 FindReferenceImage 中崩溃:

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

ShapeWorks 不参与此调用。 我想知道通过pdb运行它是否可以清除更多信息:
python -m pub RunUseCase.py --use_case femur --groom_images (然后按'r'运行)

(我现在正在运行它。崩溃需要多长时间?有没有人能够减少这种情况?)
更新:它需要这么长时间(~一个小时),但不太有用的是它只报告一个段错误,甚至不会让你留在调试器中。 我没有看到对外部脚本的调用,所以我对此感到困惑。

问题似乎是 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

回想一下,我们使用备用 VXL/VNL 构建我们的 ITK,而不是 ITK。 libvnl_algo.dylib是我们的, _ITKIOImageBasePython.so来自 conda。

我们正在混合不同的版本,所以它崩溃也就不足为奇了。

@archanasri和我只是尝试颠倒包含的顺序(再次测试#1168),但失败了。
我认为 #1168 问题的解决方案是让我们简单地构建 itkwidgets(我们现在正在尝试)。
对于这个问题,我们可以像将它指向我们的eigen一样将 itk 指向我们的vnl eigen吗?

我们已经拥有使用 VXL 的 ITK。

-DITK_USE_SYSTEM_VXL=on -DVXL_DIR=${INSTALL_DIR}

更新。 好吧,我对 Python 输出感到困惑,我认为它仍然处于中心步骤,因为没有进一步的输出。 它在 FindReferenceImage 中崩溃:

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

我的猜测是问题在于我们在内存中加载了两个不同的 ITK 库。 👎

我们可以使用 shapeworks.Image.toArray() 而不是使用 python itk。 所以我换了

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

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

它现在不会崩溃。

不错的@archanasri。 是的,我想我们可以通过这种方式绕过它。 我们基本上需要确保我们不会同时使用 python itk + 我们的 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

一个危险信号是 itk-io、-registration、-segmentation 的 5.0.1 版本,最重要的是,itk 本身。

我将 pip 安装更新为最新(有一些原因我们不能这样做,但现在把它放在一边)并重建所有依赖项。 #1168 仍然以其中描述的所有相同方式崩溃。

固定的。

此页面是否有帮助?
0 / 5 - 0 等级