-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comments
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. |
Hi Michael,
Thanks for the tip - I didn't realize using a newer python version would be
problematic. I will install python 3.11, follow your instructions, and see
if it works. Will let you know shortly.
Thanks,
Shawn
…On Thu, Oct 10, 2024 at 3:35 PM Michael Rebsamen ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFVKD34XRGMZ7SU5GJSIOZTZ23QIJAVCNFSM6AAAAABPXEDCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBVHE4TCNJTHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
|
Hi Michael,
I installed python 3.11 and followed the steps listed in your email and on
the website. When I attempt to run the program, I receive the message "zsh:
command not found: dl+direct"
Thanks again for your help.
Best,
Shawn
On Thu, Oct 10, 2024 at 4:43 PM Shawn Flanagan <
***@***.***> wrote:
… Hi Michael,
Thanks for the tip - I didn't realize using a newer python version would
be problematic. I will install python 3.11, follow your instructions, and
see if it works. Will let you know shortly.
Thanks,
Shawn
On Thu, Oct 10, 2024 at 3:35 PM Michael Rebsamen ***@***.***>
wrote:
> 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.
>
> —
> Reply to this email directly, view it on GitHub
> <#6 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BFVKD34XRGMZ7SU5GJSIOZTZ23QIJAVCNFSM6AAAAABPXEDCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBVHE4TCNJTHA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
|
One more thing, if it is helpful - I am trying to run the program in my
(default) zsh terminal.
On Fri, Oct 11, 2024 at 11:38 AM Shawn Flanagan <
***@***.***> wrote:
… Hi Michael,
I installed python 3.11 and followed the steps listed in your email and on
the website. When I attempt to run the program, I receive the message "zsh:
command not found: dl+direct"
Thanks again for your help.
Best,
Shawn
On Thu, Oct 10, 2024 at 4:43 PM Shawn Flanagan <
***@***.***> wrote:
> Hi Michael,
>
> Thanks for the tip - I didn't realize using a newer python version would
> be problematic. I will install python 3.11, follow your instructions, and
> see if it works. Will let you know shortly.
>
> Thanks,
>
> Shawn
>
> On Thu, Oct 10, 2024 at 3:35 PM Michael Rebsamen <
> ***@***.***> wrote:
>
>> 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.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#6 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/BFVKD34XRGMZ7SU5GJSIOZTZ23QIJAVCNFSM6AAAAABPXEDCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBVHE4TCNJTHA>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
>
> --
> *Shawn Flanagan, PhD*
> Associate Professor
> Director, Human Performance Laboratory
> Department of Podiatric Medicine and Surgery
> Dr. William M. Scholl College of Podiatric Medicine
> Neuroscience Program
> School of Graduate and Postdoctoral Studies
> ***@***.*** ***@***.***>
>
>
>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
|
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, |
Hi Michael,
No problem - here you go - really appreciate your help! Thanks again.
Best,
Shawn
…On Fri, Oct 11, 2024 at 3:00 PM Michael Rebsamen ***@***.***> wrote:
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
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFVKD3YTPPLERKP7EUXT4LDZ3AU5TAVCNFSM6AAAAABPXEDCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGA2DMOBQHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
Last login: Fri Oct 11 11:23:15 on ttys002
***@***.*** ~ % conda create -n DL_DiReCT python=3.11
WARNING: A conda environment already exists at '/opt/miniconda3/envs/DL_DiReCT'
Remove existing environment (y/[n])? y
Channels:
- defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/miniconda3/envs/DL_DiReCT
added / updated specs:
- python=3.11
The following NEW packages will be INSTALLED:
bzip2 pkgs/main/osx-arm64::bzip2-1.0.8-h80987f9_6
ca-certificates pkgs/main/osx-arm64::ca-certificates-2024.9.24-hca03da5_0
libffi pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_1
ncurses pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0
openssl pkgs/main/osx-arm64::openssl-3.0.15-h80987f9_0
pip pkgs/main/osx-arm64::pip-24.2-py311hca03da5_0
python pkgs/main/osx-arm64::python-3.11.10-hb885b13_0
readline pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0
setuptools pkgs/main/osx-arm64::setuptools-75.1.0-py311hca03da5_0
sqlite pkgs/main/osx-arm64::sqlite-3.45.3-h80987f9_0
tk pkgs/main/osx-arm64::tk-8.6.14-h6ba3021_0
tzdata pkgs/main/noarch::tzdata-2024b-h04d1e81_0
wheel pkgs/main/osx-arm64::wheel-0.44.0-py311hca03da5_0
xz pkgs/main/osx-arm64::xz-5.4.6-h80987f9_1
zlib pkgs/main/osx-arm64::zlib-1.2.13-h18a0788_1
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate DL_DiReCT
#
# To deactivate an active environment, use
#
# $ conda deactivate
***@***.*** ~ % conda activate DL_DiReCT
***@***.*** ~ % cd ${HOME}
git clone https://github.com/SCAN-NRAD/DL-DiReCT.git
cd DL-DiReCT
pip install numpy && pip install -e
Cloning into 'DL-DiReCT'...
^[[Dremote: Enumerating objects: 201, done.
remote: Counting objects: 100% (106/106), done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 201 (delta 62), reused 80 (delta 38), pack-reused 95 (from 1)
Receiving objects: 100% (201/201), 163.53 MiB | 40.37 MiB/s, done.
Resolving deltas: 100% (107/107), done.
Collecting numpy
Using cached numpy-2.1.2-cp311-cp311-macosx_14_0_arm64.whl.metadata (60 kB)
Using cached numpy-2.1.2-cp311-cp311-macosx_14_0_arm64.whl (5.4 MB)
Installing collected packages: numpy
Successfully installed numpy-2.1.2
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
-e option requires 1 argument
***@***.*** DL-DiReCT % dl+direct --subject ACL2 --bet /Users/neurolab/Documents/BBACL/5_DL_DiReCT/Sources/ACL2_T1.nii.gz /Users/neurolab/Documents/BBACL/5_DL_DiReCT/Outputs
zsh: command not found: dl+direct
***@***.*** DL-DiReCT %
|
Hi Shawn, There is a dot (.) missing at the end of the command, it should be exactly like this:
The dot (.) refers to the current working directory, telling pip to install it from here. |
Hi Michael,
It worked! Thank you for your help. The power of a simple dot. I tried to
run the batch version, but cannot seem to get a working java runtime
version in place (the batch command stated that "parallel not found", and
applying the recommended script (sudo apt install parallel) led to
message "The operation couldn’t be completed. Unable to locate a Java
Runtime that supports apt.
Please visit http://www.java.com for information on installing Java". Am
not sure if I am missing something, or if there is a workaround - from your
previous email, it seems that a few things may need to happen before
batching/GPU/parallel functions can be done on M2 Mac?
Thanks again and cheers,
Shawn
…On Fri, Oct 11, 2024 at 4:44 PM Michael Rebsamen ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFVKD33N2PCRCJHTQV5QVDLZ3BBDRAVCNFSM6AAAAABPXEDCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGE2TQNZVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Shawn Flanagan, PhD*
Associate Professor
Director, Human Performance Laboratory
Department of Podiatric Medicine and Surgery
Dr. William M. Scholl College of Podiatric Medicine
Neuroscience Program
School of Graduate and Postdoctoral Studies
***@***.*** ***@***.***>
|
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, |
Should run now also natively on Apple silicon with MPS. Batch mode requires installing the parallel command using:
|
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
The text was updated successfully, but these errors were encountered: