Running on Mac M1
Closed this issue · 5 comments
Hi, has anyone tried to run this on a M1 Mac? I've followed various guides for installing tensorflow on M1 but I'm running into several problems including package compatibility... I can provide more details if needed.
Hi,
I recently updated the installation instructions, because people ran into package compatibility problems. The new instructions should solve these issues, so let me know how it goes ! :)
Best,
Benjamin
Thanks Benjamin. I tried to install with the current instructions but still running into problems. The commands I run are
conda create -n synthseg_38 python=3.8
conda activate synthseg_38
pip install .
This gives a long error output from a subprocess error, raised by clang
. I think this is caused by tensorflow issues and nothing particular to SynthSeg.
Sorry but just follow one of the commands provided in the README:
# Conda, Python 3.6:
conda create -n synthseg_36 python=3.6 tensorflow-gpu=2.0.0 keras=2.3.1 h5py==2.10.0 nibabel matplotlib -c anaconda -c conda-forge
# Conda, Python 3.8:
conda create -n synthseg_38 python=3.8 tensorflow-gpu=2.2.0 keras=2.3.1 nibabel matplotlib -c anaconda -c conda-forge
# Pip, Python 3.6:
pip install tensorflow-gpu==2.0.0 keras==2.3.1 nibabel==3.2.2 matplotlib==3.3.4
# Pip, Python 3.8:
pip install tensorflow-gpu==2.2.0 keras==2.3.1 protobuf==3.20.3 numpy==1.23.5 nibabel==5.0.1 matplotlib==3.6.2
This will automatically install all the dependencies plus the deep learning libraries.
I tried it on several machines with different OS, and it work every single time :)
Let me know if you still have an error after using one of these !
Benjamin
Thanks Benjamin, sorry for the misstake. I still run into problems, which seems to be related to the ARM architecture.
Conda Python 3.8
> conda create -n synthseg_38 python=3.8 tensorflow-gpu=2.2.0 keras=2.3.1 nibabel matplotlib -c anaconda -c conda-forge
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- keras=2.3.1
- tensorflow-gpu=2.2.0
Current channels:
- https://conda.anaconda.org/anaconda/osx-arm64
- https://conda.anaconda.org/anaconda/noarch
- https://conda.anaconda.org/conda-forge/osx-arm64
- https://conda.anaconda.org/conda-forge/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Conda Python 3.6
> conda create -n synthseg_36 python=3.6 tensorflow-gpu=2.0.0 keras=2.3.1 h5py==2.10.0 nibabel matplotlib -c anaconda -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- keras=2.3.1
- tensorflow-gpu=2.0.0
- python=3.6
Current channels:
- https://conda.anaconda.org/anaconda/osx-arm64
- https://conda.anaconda.org/anaconda/noarch
- https://conda.anaconda.org/conda-forge/osx-arm64
- https://conda.anaconda.org/conda-forge/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
And with pip at python 3.8
> pip install tensorflow-gpu==2.2.0 keras==2.3.1 protobuf==3.20.3 numpy==1.23.5 nibabel==5.0.1 matplotlib==3.6.2
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==2.2.0 (from versions: 2.12.0)
ERROR: No matching distribution found for tensorflow-gpu==2.2.0
Have you tested it on a Mac with M1?
Wait, this is not a compatibility issue, since conda/pip don't even find the packages in the first place.
So the problem is with the installation of conda/python/pip, and is not related to SynthSeg.
I don't know what the M1 thing is on Mac, but you might want to look at how to install conda/python on it.
I'm closing this issue, because SynthSeg has nothing to do with it.
Good luck !
Benjamin