Comments (8)
Segmentation fault is a curious error. In fact, usually python's guarantee would be that segmentation faults cannot/should not happen. Generally, it is very unlikely to be a bug in our code.
As a quick check to see if/how the call to python is correct, can you please add:
--py python3.10
to your command.
Are you able to (confidentially) share the image file with us? Then we can try to reproduce the error on-site.
Otherwise, are you able to check on a different machine/different FastSurfer version (e.g. docker pull deepmi/fastsurfer:gpu-v2.1.2
). Or even the cpu-docker (docker pull deepmi/fastsurfer:cpu-v2.2.0
)?
from fastsurfer.
Also check if Nvidia GPU is installed correctly on the host, run nvidia-smi . How much RAM does the host system have and how much the GPU?
from fastsurfer.
Thanks a lot for your replies.
using --py python3.10
works fine. Using deepmi/fastsurfer:gpu-v2.1.2
leads to:
N4 Bias Correction Parameters:
- input volume: /output/subjectX/mri/orig.mgz
- output volume: /output/subjectX/mri/orig_nu.mgz
- mask: /output/subjectX/mri/mask.mgz
- shrink factor: 4
- number fitting levels: 4
- number iterations: 50
- convergence threshold: 0.0
- skipwm: False
- threads: 1
reading /output/subjectX/mri/orig.mgz
read MGZ (FreeSurfer) image via nibabel...
read MGZ (FreeSurfer) image via nibabel...executing N4 correction ...
Traceback (most recent call last):
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 333, in
itkcorrected = N4correctITK(
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 158, in N4correctITK
corrector.Execute(itkimage, itkmask)
File "/venv/lib/python3.8/site-packages/SimpleITK/SimpleITK.py", line 43070, in Execute
return _SimpleITK.N4BiasFieldCorrectionImageFilter_Execute(self, *args)
RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrectionImageFilter_Execute: /tmp/SimpleITK/Code/BasicFilters/src/sitkImageFilter.cxx:63:
sitk::ERROR: Input "maskImage" for "N4BiasFieldCorrectionImageFilter" has size of [ 99, 99, 99 ] which does not match the primary input's size of [ 79, 79, 79 ]!
ERROR: Biasfield correction failed
When using other images
[ 79, 79, 79 ]
changes accordingly.
Using
deepmi/fastsurfer:cpu-v2.2.0
is still running but seems to work. Does it use the regular recon-all command from freesurfer?
Total RAM is 62.7GB.
from fastsurfer.
The error in 2.1.2 does surprise me. But I don't think it is related.
It seems the python-s
handle is causing the issue. We have removed this handle for the next version and I think you are able to workaround this issue by specifying --py python3.10
which is in effect almost the sam. Just make sure you are not mounting a home directory, because you are loosing the -s
flag for python which usually disabled loading python packages from the home directory and therefore potentially changing the versions of python packages.
from fastsurfer.
Does it use the regular recon-all command from freesurfer?
recon-surf uses many of FreeSurfer's binaries and recon-all calls, but is a different pipeline. First, we can skip many steps as we already have a full brain segmentation from the neural network, second we optimize (and fix) multiple steps for speed (e.g. surface inflation, resulting in less topological defects) and reliability (improved spherical rotational pre-alignment to stabilize location of the central sulcus) compared to recon-all.
I will close this issue now as we have a workaround and this "should" be fixed in the next release as we dropped the python-s script. Happy to re-open if anything comes up.
from fastsurfer.
I am sorry, misunderstood. When adding --py python3.10
I do not get an error specifically concerning python but still an error:
sudo docker run --gpus all \
-v /media/stn/data1/Brain_vs_Gut/FreeSurfer/anat_t1_2007_2023:/data \
-v /media/stn/data1/Brain_vs_Gut/FreeSurfer/FastSurfer:/output \
-v /media/stn/data1/Brain_vs_Gut/FreeSurfer/license.txt:/fs_license/license.txt \
--rm --user $(id -u):$(id -g) deepmi/fastsurfer:latest \
--py python3.10 \
--fs_license /fs_license/license.txt \
--t1 /data/2014_09_29/anat_t1.nii \
--sid 2014_09_29 --sd /output
Version: 2.2.0+9f37d02
Fri Jul 12 15:43:29 UTC 2024
python3.10 /fastsurfer/FastSurferCNN/run_prediction.py --t1 /data/2014_09_29/anat_t1.nii --asegdkt_segfile /output/subjectX/mri/aparc.DKTatlas+aseg.deep.mgz --conformed_name /output/subjectX/mri/orig.mgz --brainmask_name /output/subjectX/mri/mask.mgz --aseg_name /output/subjectX/mri/aseg.auto_noCCseg.mgz --sid subjectX --seg_log /output/subjectX/scripts/deep-seg.log --vox_size min --batch_size 1 --viewagg_device auto --device auto
ERROR: FastSurfer asegdkt segmentation failed.
/fastsurfer/run_fastsurfer.sh: line 797: 46 Segmentation fault (core dumped) $cmd
from fastsurfer.
Cam you share the deepseg.log file of that subject (in scripts).
And CPU and GPU information, so lscpu
and nvidia-smi
on the host.
from fastsurfer.
Here the information:
deepseg.log:
Version: 2.2.0+9f37d02
Log file for segmentation FastSurferCNN/run_prediction.py
Fri Jul 12 19:47:13 UTC 2024
python3.10 /fastsurfer/FastSurferCNN/run_prediction.py --t1 /data/2020_10_09.nii --asegdkt_segfile /output/2020_10_09.nii/mri/aparc.DKTatlas+aseg.deep.mgz --conformed_name /output/2020_10_09.nii/mri/orig.mgz --brainmask_name /output/2020_10_09.nii/mri/mask.mgz --aseg_name /output/2020_10_09.nii/mri/aseg.auto_noCCseg.mgz --sid 2020_10_09.nii --seg_log /output/2020_10_09.nii/scripts/deep-seg.log --vox_size min --batch_size 1 --viewagg_device auto --device auto
~
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 43 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 7 3800X 8-Core Processor
CPU family: 23
Model: 113
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU max MHz: 4558,8862
CPU min MHz: 2200,0000
BogoMIPS: 7785.51
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx
fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_goo
d nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fm
a cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm
extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topo
ext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ss
bd mba ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap cl
flushopt clwb sha_ni xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cq
m_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_sav
e tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vms
ave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sev sev_es
Virtualization features:
Virtualization: AMD-V
Caches (sum of all):
L1d: 256 KiB (8 instances)
L1i: 256 KiB (8 instances)
L2: 4 MiB (8 instances)
L3: 32 MiB (2 instances)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerabilities:
Gather data sampling: Not affected
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Mitigation; untrained return thunk; SMT enabled with STIBP protection
Spec rstack overflow: Mitigation; Safe RET
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP always-on; RSB filling; PBRSB-eIBRS
Not affected; BHI Not affected
Srbds: Not affected
Tsx async abort: Not affected
from fastsurfer.
Related Issues (20)
- FastSurfer QuickSeg doesn't work with OASIS `.img` files HOT 3
- Docker build workflows HOT 5
- Model download issue HOT 22
- invalid index in smooth_aparc.py HOT 7
- FastSufer for multiple subjects HOT 4
- DKTAtlas instead of aparc.stats file in FastSurfer HOT 3
- recon_surf//functions.sh: line 38: -debug: command not found HOT 6
- no-cache argument for build.py HOT 2
- Updated Docker Image HOT 1
- Website hosting checkpoints down HOT 5
- Anterior/Posterior Commissure Segmentation HOT 6
- Surface module fail in dev HOT 6
- Reference to deprecated docker images in surface pipeline docs HOT 5
- Corresponding Stats output of FastSurfer to "Recon-all" HOT 6
- Missing files compared to freesurfer HOT 5
- CerebNet support for submillimeter images? HOT 2
- Cannot use Fastsurfer with Apple M3 Pro HOT 12
- CUDA Capability Issue with "current" PyTorch HOT 4
- conform.py fails for numpy 2.0.0 and later HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastsurfer.