Re: [ITK-users] ITKModuleTemplate and external modules for use with python
Dženan Zukić <[email protected]> Mon, 16 Jul 2018 12:35:28 -0400
| Newsgroups | gmane.comp.lib.itk.user |
|---|---|
| Message-ID | <CAPf2UMRjbkX4ZsdBMLzi3UynTMFC5kjNK+1V6SWu__6CpcK7VA@mail.gmail.com> |
--===============1421354890== Content-Type: multipart/alternative; boundary="000000000000e4c0c40571206b97" --000000000000e4c0c40571206b97 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Darren, can you please re-post this question on the forum <https://discourse.itk.org/>? Many of us were on vacation in the last few weeks. Regards, D=C5=BEenan On Thu, Jul 12, 2018 at 7:47 AM <[email protected]> wrote: > Hi All, > > > > I=E2=80=99m revisiting making my own external ITK module (for use in Pyth= on) after > an initial attempt a while back. This time I=E2=80=99ve managed to get mu= ch further > and have managed to successfully create python wheels following the > directions on > https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master= /docs/Build_ITK_Module_Python_packages.rst > , I=E2=80=99ve created Windows wheels via AppVeyor and linux wheels with= CircleCI > in addition to locally built versions via the docker based method. All > tests are passed successfully. > > > > However, after installing them with pip in a fresh virtual environment in > a Python 3.6 instance (Anaconda), I seem to always get a kernel crash > (segmentation fault) when I try and actually use or create one of my cust= om > filters. > > > > To strip everything back to basics I generated a vanilla external module, > using only default values with: > > > > python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate > > > > I then built the wheels as described and installed them into the virtual > environment. > > > > Using the following basic python script below results in a seg fault, > > > > import itk > > InputType =3D itk.Image[itk.F,2] > > OutputType =3D itk.Image[itk.F,2] > > test =3D itk.MinimalStandardRandomVariateGenerator.New() > > > > I get the same result if I try and create any of the classes defined in > ITKModuleTemplate, however I can successfully create standard itk filters= . > > > > After running the script with gdb I see that it crashes in the call as > follows: > > > > #1 0x00007fffe7405373 in PyInit__ModuleTemplatePython () from > /home/tho78s/anaconda3/lib/python3.6/site-packages/itk/Configuration/../_= ModuleTemplatePython.so > > > > I=E2=80=99m currently out of ideas as to where the problem lies and I see= m to get > the identical problem in Windows too. > > > > Any help or pointers in to what is going wrong would be greatly > appreciated! > > > > I you want any extra info, feel free to contact me. > > > > Regards, > > > > Darren > > > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > https://itk.org/mailman/listinfo/insight-users > --000000000000e4c0c40571206b97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,= sans-serif;font-size:small">Hi Darren,</div><div class=3D"gmail_default" st= yle=3D"font-family:verdana,sans-serif;font-size:small"><br></div><div class= =3D"gmail_default" style=3D"font-family:verdana,sans-serif;font-size:small"= >can you please re-post this question on the <a href=3D"https://discourse.i= tk.org/">forum</a>? Many of us were on vacation in the last few weeks.</div= ><div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif;font-= size:small"><br></div><div class=3D"gmail_default" style=3D"font-family:ver= dana,sans-serif;font-size:small">Regards,</div><div class=3D"gmail_default"= style=3D"font-family:verdana,sans-serif;font-size:small">D=C5=BEenan</div>= </div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Thu, Jul 12, 2018 = at 7:47 AM <[email protected]> wrote:<br></div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa= dding-left:1ex"> <div lang=3D"EN-AU" link=3D"#0563C1" vlink=3D"#954F72"> <div class=3D"m_1997716889707673519WordSection1"> <p class=3D"MsoNormal">Hi All,<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">I=E2=80=99m revisiting making my own external ITK mo= dule (for use in Python) after an initial attempt a while back. This time I= =E2=80=99ve managed to get much further and have managed to successfully cr= eate python wheels following the directions on <a href=3D"https://github.com/InsightSoftwareConsortium/ITKPythonPackage/bl= ob/master/docs/Build_ITK_Module_Python_packages.rst" target=3D"_blank"> https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/d= ocs/Build_ITK_Module_Python_packages.rst</a> =C2=A0, I=E2=80=99ve created W= indows wheels via AppVeyor and linux wheels with CircleCI in addition to lo= cally built versions via the docker based method. All tests are passed successfully.<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">However, after installing them with pip in a fresh v= irtual environment in a Python 3.6 instance (Anaconda), I seem to always ge= t a kernel crash (segmentation fault) when I try and actually use or create= one of my custom filters. <u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">To strip everything back to basics I generated a van= illa external module, using only default values with: <u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">python -m cookiecutter gh:InsightSoftwareConsortium/= ITKModuleTemplate<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">I then built the wheels as described and installed t= hem into the virtual environment.<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">Using the following basic python script below result= s in a seg fault, <u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">= import itk<u></u><u></u></span></p> <p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">= InputType =3D itk.Image[itk.F,2]<u></u><u></u></span></p> <p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">= OutputType =3D itk.Image[itk.F,2]<u></u><u></u></span></p> <p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">= test =3D itk.MinimalStandardRandomVariateGenerator.New() <u></u><u></u></span></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">I get the same result if I try and create any of the= classes defined in ITKModuleTemplate, however I can successfully create st= andard itk filters.<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">After running the script with gdb I see that it cras= hes in the call as follows:<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">= #1=C2=A0 0x00007fffe7405373 in PyInit__ModuleTemplatePython () from /home/t= ho78s/anaconda3/lib/python3.6/site-packages/itk/Configuration/../_ModuleTem= platePython.so<u></u><u></u></span></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">I=E2=80=99m currently out of ideas as to where the p= roblem lies and I seem to get the identical problem in Windows too.<u></u><= u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">Any help or pointers in to what is going wrong would= be greatly appreciated!<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">I you want any extra info, feel free to contact me.<= u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">Regards,<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> <p class=3D"MsoNormal">Darren<u></u><u></u></p> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> </div> The ITK community is transitioning from this mailing list to <a href=3D"htt= p://discourse.itk.org" rel=3D"noreferrer" target=3D"_blank">discourse.itk.o= rg</a>. Please join us there!<br> ________________________________<br> Powered by <a href=3D"http://www.kitware.com" rel=3D"noreferrer" target=3D"= _blank">www.kitware.com</a><br> <br> Visit other Kitware open-source projects at<br> <a href=3D"http://www.kitware.com/opensource/opensource.html" rel=3D"norefe= rrer" target=3D"_blank">http://www.kitware.com/opensource/opensource.html</= a><br> <br> Kitware offers ITK Training Courses, for more information visit:<br> <a href=3D"http://www.kitware.com/products/protraining.php" rel=3D"noreferr= er" target=3D"_blank">http://www.kitware.com/products/protraining.php</a><b= r> <br> Please keep messages on-topic and check the ITK FAQ at:<br> <a href=3D"http://www.itk.org/Wiki/ITK_FAQ" rel=3D"noreferrer" target=3D"_b= lank">http://www.itk.org/Wiki/ITK_FAQ</a><br> <br> Follow this link to subscribe/unsubscribe:<br> <a href=3D"https://itk.org/mailman/listinfo/insight-users" rel=3D"noreferre= r" target=3D"_blank">https://itk.org/mailman/listinfo/insight-users</a><br> </blockquote></div> --000000000000e4c0c40571206b97-- --===============1421354890== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: https://itk.org/mailman/listinfo/insight-users --===============1421354890==--