Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using dl+DiReCT on Mac Studio #6

Open
SDFsci opened this issue Oct 10, 2024 · 10 comments
Open

Using dl+DiReCT on Mac Studio #6

SDFsci opened this issue Oct 10, 2024 · 10 comments

Comments

@SDFsci
Copy link

SDFsci commented Oct 10, 2024

Hello,

I am wondering if you can provide more detailed step by step instructions on how to successfully execute this program in a Mac terminal (I have an M2 Mac Studio). I have installed miniconda, confirmed python3.12, cloned the repository, run setup.py for HD-BET and dl+direct) and am still struggling to get the program to work. My coding skills are limited, as you can see. Appreciate your help and maybe this will help many others as well!

Best,

Shawn

@mrunibe
Copy link
Member

mrunibe commented Oct 10, 2024

Hi Shawn,

It should actually run on Mac as well, but it requires python 3.11 instead of 3.12.

Create conda environment with python 3.11:

conda create -n DL_DiReCT python=3.11
conda activate DL_DiReCT

Then follow the instructions to install DL+DiRect: https://github.com/SCAN-NRAD/DL-DiReCT#install-dldirect

Now you should be able to run with

dl+direct  --bet --lowmem path_to_T1.nii.gz out

This will run on the CPU only and hence rather slow. However, it should soon also be possible to leverage the GPU on Mac with a newer pytorch version.

If you still experience any problems, please let me know and also post any error messages that you see.

@SDFsci
Copy link
Author

SDFsci commented Oct 10, 2024 via email

@SDFsci
Copy link
Author

SDFsci commented Oct 11, 2024 via email

@SDFsci
Copy link
Author

SDFsci commented Oct 11, 2024 via email

@mrunibe
Copy link
Member

mrunibe commented Oct 11, 2024

Hi Shawn,

I suspect something went wrong in the installation, but hard to tell what without all the details.

Would you be able to export the entire shell output? If you still have it all in the terminal where you did the installation and also tried to run 'dl+direct': Choose 'Shell' -> 'Export Text As...' and save as .txt and send to me. That would be very helpful.

If you don't have the terminal output anymore, just run the installation and dl+direct again in a new terminal and export the output.

Best Regards,
Michael

@SDFsci
Copy link
Author

SDFsci commented Oct 11, 2024 via email

@mrunibe
Copy link
Member

mrunibe commented Oct 11, 2024

Hi Shawn,

There is a dot (.) missing at the end of the command, it should be exactly like this:

pip install numpy && pip install -e .

The dot (.) refers to the current working directory, telling pip to install it from here.

@SDFsci
Copy link
Author

SDFsci commented Oct 11, 2024 via email

@mrunibe
Copy link
Member

mrunibe commented Oct 12, 2024

Hi Shawn,

The purpose of the batch version (with the help of the linux parallel command) is to process several MRI in parallel on a high-performance infrastructure with a GPU powerful enough to run several jobs simultaneously. This is likely not the case with an M2 and I would recommend to run multiple cases sequentially.

Kind Regards,
Michael

mrunibe added a commit that referenced this issue Oct 15, 2024
@mrunibe
Copy link
Member

mrunibe commented Oct 15, 2024

Should run now also natively on Apple silicon with MPS.

Batch mode requires installing the parallel command using:

conda install conda-forge::parallel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants