Skip to content

Cannot use totalspineseg in singularity anymore #124

@lchauvin

Description

@lchauvin

Hello,

Since recently (few days / weeks ago), I cannot use totalspineseg in a singularity image.

I installed totalspineseg using pip in the singularity image like this, in a requirement file:

totalspineseg[neuropoly]

and in the image definition file:

${SCT_DIR}/bin/sct_deepseg totalspineseg -install

I believe it was still working few days ago, but now I have this error:

File "/opt/sct/sct_wrapper.py", line 1923, in segment_vertebrae
  sct_deepseg.main(['totalspineseg', '-i', in_image, '-o', os.path.join(totalspineseg_dir, 'out.nii.gz'),
File "/opt/sct/spinalcordtoolbox/scripts/sct_deepseg.py", line 489, in main
  im_lst, target_lst = inference.segment_non_ivadomed(
File "/opt/sct/spinalcordtoolbox/deepseg/inference.py", line 137, in segment_non_ivadomed
  fnames_out, targets = inference(path_img=fname_in, tmpdir=tmpdir, predictor=net, device=device, **extra_inference_kwargs)
File "/opt/sct/spinalcordtoolbox/deepseg/inference.py", line 411, in segment_totalspineseg
  tss_inference(
File "/opt/sct/python/envs/venv_sct/lib/python3.10/site-packages/totalspineseg/inference.py", line 446, in inference
  add_trainer("nnUNetTrainerDAExt")
File "/opt/sct/python/envs/venv_sct/lib/python3.10/site-packages/auglab/add_trainer.py", line 45, in add_trainer
  shutil.copy(source_trainer, output_path)
File "/opt/sct/python/envs/venv_sct/lib/python3.10/shutil.py", line 417, in copy
  copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/opt/sct/python/envs/venv_sct/lib/python3.10/shutil.py", line 256, in copyfile
  with open(dst, 'wb') as fdst:
OSError: [Errno 30] Read-only file system: '/opt/sct/python/envs/venv_sct/lib/python3.10/site-packages/nnunetv2/training/nnUNetTrainer/nnUNetTrainerDAExt.py'

It seems the code try to copy some files inside the package, but after building the singularity image, this is a read-only directory.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions