Can't install `sct_deepseg` task due to network errors

some problem with task installed

Dear @jiang,

This looks to be a connection issue with your network. It seems to partially finish the download, then fail midway through.

It may be a one-time error due to a network fluke. Can you please retry the command to see if this happens multiple times? (Does it fail at the same 23% point every time?)

If it repeatedly fails, then I would recommend trying on a more stable connection. Or, there may be a workaround we can do by manually downloading the files and putting them in the correct directory.

Kind regards,
Joshua

OK, how can I download and add this mask.

how to download and install the task?

For version 6.5, to download the task automatically, run:

sct_deepseg -install seg_sc_contrast_agnostic

If this command runs into network errors (23%, 58%, etc.), then you can download the model manually by running the following steps:

# extract the model `.zip` into the model folder
cd ~/Downloads
unzip model_contrast-agnostic_20240930-1002.zip -d $SCT_DIR/data/deepseg_models/

# rename the model folder to the expected name
cd $SCT_DIR/data/deepseg_models/
rm -rf model_seg_sc_contrast_agnostic_softseg_monai
mv model_contrast-agnostic_20240930-1002 model_seg_sc_contrast_agnostic_softseg_monai

# add a `source.json` file to the model folder
cd model_seg_sc_contrast_agnostic_softseg_monai
echo '{"model_name":"model_seg_sc_contrast_agnostic_softseg_monai","model_urls":"https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/releases/download/v2.5/model_contrast-agnostic_20240930-1002.zip","custom":false}' > source.json

Here is a screen recording of me performing these steps:

After these steps are complete, you should see the task listed as green (installed) in sct_deepseg -h.

Kind regards,
Joshua

Oh, I see now. In this screenshot, you are using the spinalcord model. This model name corresponds to the latest version of SCT (v7.0).

So, you have two options:

  • If you want to keep using SCT v6.5, then you should read the documentation from the 6.5 version: Spinal Cord Toolbox documentation (6.5)
  • If you want to use the up-to-date documentation (stable), then you will need to install the most recent stable version of SCT (v7.0).

Kind regards,
Joshua


I do this,but still something error



Both methods failed.

It looks like the model installed successfully, as the seg_sc_contrast_agnostic task has the green color (installed).

What is the issue you are having?

Kindly,
Joshua

other still can’t down

If you want to download other tasks, you will need to follow the same steps as described in my earlier reply https://forum.spinalcordmri.org/t/cant-install-sct-deepseg-task-due-to-network-errors/1454/8?u=joshuacwnewton, but you have to change the name.

In other words:

  • You can try running sct_deepseg -install [TASK_NAME] for each task that you want to install.
  • If you continue to run into network errors, you will need to do the “manual” install (downloading the zip, unzipping the files, renaming the folder):
    • SCT has a list of models and their URLs in the code.
    • You will have to find the model that you want to install, download the .zip folder from the URL, unzip the .zip file, then rename the folder to whatever the name of the model is.

Please note that usually the manually installation is not necessary. If you have a good internet connection, sct_deepseg will take care of the installation for you.

Thank you for your patience, and sorry again for the inconvenience.

Kind regards,
Joshua

Please note: It is normal and OK for all tasks to not be installed by default.

Model files are large (>300MB), and most users do not need all of the models, so SCT chooses to only install some models by default to save on disk space.

I would recommend that you only download and install the models that you need for your analysis.

Kind regards,
Joshua