TractSeg icon indicating copy to clipboard operation
TractSeg copied to clipboard

Docker_CPU downloads weights to /root/.tractseg, creating complications when running as singularity container

Open ajschadler12 opened this issue 1 year ago • 3 comments

For the purposes of running TractSeg on a local compute cluster, I converted the docker container to a singularity image. However, since Docker_CPU downloads the pre-trained weights to /root/.tractseg/, the converted singularity container cannot access the weights, and subsequently downloads the weights to ${HOME}/.tractseg/.

A potential workaround I have found is to move the weights to a global-readable directory (e.g. /usr/local/share/tractseg) and set TRACTSEG_WEIGHTS_DIR to said directory in /code/startup.sh.

ajschadler12 avatar Aug 29 '22 22:08 ajschadler12

TractSeg is able to run this way for tract-segmentations and ending-segmentations, but fails for TOM. It tries to find the files in ${HOME}/.tractseg instead of $TRACTSEG_WEIGHTS_DIR. Does this need to be set via an option?

ajschadler12 avatar Aug 29 '22 23:08 ajschadler12

This is quite strange. For TOM it should look for the weights at the same directory as for tract segmentation. Are you sure inside of your $TRACTSEG_WEIGHTS_DIR you have downloaded the TOM weights? The directory should look similar to the following:

pretrained_weights_endings_segmentation_v4.npz
pretrained_weights_peak_regression_part1_v2.npz
pretrained_weights_peak_regression_part2_v2.npz
pretrained_weights_peak_regression_part3_v2.npz
pretrained_weights_peak_regression_part4_v2.npz
pretrained_weights_tract_segmentation_v3.npz

wasserth avatar Aug 30 '22 09:08 wasserth

Yep, the weights are all there:

Apptainer> echo $TRACTSEG_WEIGHTS_DIR
/usr/local/share/tractseg/
Apptainer> ls $TRACTSEG_WEIGHTS_DIR/
pretrained_weights_dm_regression_v2.npz
pretrained_weights_dm_regression_xtract_v1.npz
pretrained_weights_endings_segmentation_v4.npz
pretrained_weights_peak_regression_part1_v2.npz
pretrained_weights_peak_regression_part2_v2.npz
pretrained_weights_peak_regression_part3_v2.npz
pretrained_weights_peak_regression_part4_v2.npz
pretrained_weights_tract_segmentation_v3.npz
pretrained_weights_tract_segmentation_xtract_v1.npz

ajschadler12 avatar Aug 30 '22 15:08 ajschadler12