Skip to content

Commit fc421af

Browse files
committed
Simplify the installation steps
1 parent 3ce6bf5 commit fc421af

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

index.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,14 @@ conda activate BiaPy_env
128128
Then you will need to install <a href="https://pypi.org/project/biapy/" target="_blank" rel="noopener noreferrer">BiaPy package</a> and <a href="https://pytorch.org/get-started/locally/" target="_blank" rel="noopener noreferrer">Pytorch</a>:
129129

130130
```bash
131-
pip install biapy
132-
133-
# To install with GPU support: Pytorch 2.4.0 + CUDA 11.8
134-
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu118
131+
# Pytorch installation with GPU support: Pytorch 2.4.0 + CUDA 11.8
132+
pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu118
135133

136-
# Only CPU support: Pytorch 2.4.0
137-
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cpu
134+
# Pytorch installation with ONLY CPU support: Pytorch 2.4.0
135+
pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cpu
138136

139-
# Finally install some packages that rely on the Pytorch installation
140-
pip install timm==1.0.14 pytorch-msssim torchmetrics[image]==1.4.*
137+
# Finally install BiaPy
138+
pip install biapy
141139
```
142140

143141
The PyPI package does not install <a href="https://pytorch.org/get-started/locally/" target="_blank" rel="noopener noreferrer">Pytorch</a> because there is no option to build that package specifying exactly the CUDA version you want to use. There are a few solutions to set up ``pyproject.toml`` with poetry and specify the CUDA version, as discussed <a href="https://github.com/python-poetry/poetry/issues/6409" target="_blank" rel="noopener noreferrer">here</a>, but then PyPI package can not be built (as stated <a href="https://peps.python.org/pep-0440/#direct-references" target="_blank" rel="noopener noreferrer">here</a>).
@@ -166,19 +164,13 @@ mamba activate BiaPy_env
166164
Now you need to install <a href="https://pytorch.org/get-started/locally/" target="_blank" rel="noopener noreferrer">Pytorch</a> and related packages. Double check <a href="https://pytorch.org/get-started/locally/" target="_blank" rel="noopener noreferrer">Pytorch's official page</a> for its specific installation. For example, to install the lastest version of <a href="https://pytorch.org/get-started/locally/" target="_blank" rel="noopener noreferrer">Pytorch</a> with ``conda`` installation in Windows OS under CUDA 12.1:
167165

168166
```bash
169-
mamba install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
167+
mamba install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia
170168
```
171169

172170
Alternatively, for macOS it would be like this:
173171

174172
```bash
175-
mamba install pytorch::pytorch torchvision torchaudio -c pytorch
176-
```
177-
178-
Then, add extra pytorch related packages:
179-
180-
```bash
181-
mamba install timm==1.0.14 torchmetrics
173+
mamba install pytorch::pytorch torchvision -c pytorch
182174
```
183175

184176
Install BiaPy Dependencies:
@@ -188,13 +180,13 @@ mamba install pytz asciitree tzdata typer tqdm torchinfo tifffile threadpoolctl
188180
mamba install six Shapely scipy ruamel.yaml.clib pyparsing protobuf numcodecs lazy_loader kiwisolver
189181
mamba install joblib h5py fonttools fastremap fasteners cycler contourpy zarr=2.16.1 scikit-learn=1.4.0
190182
mamba install scikit-image ruamel.yaml python-dateutil pydot=1.4.2 pandas matplotlib xarray imgaug yaml
191-
mamba install bioimageio.spec bioimageio.core=0.7.0
183+
mamba install bioimageio.spec bioimageio.core=0.9.0
192184
```
193185

194186
Install packages not available on conda-forge, so install it via pip:
195187

196188
```bash
197-
pip install fill-voids pytorch_msssim opencv-python opencv-python-headless imagecodecs==2024.1.1 numpy==1.25.2 pooch tensorboardX==2.6.2.2 yacs==0.1.8 edt==2.3.2
189+
pip install fill-voids pytorch_msssim opencv-python opencv-python-headless imagecodecs==2024.1.1 "numpy>=2" pooch tensorboardX==2.6.2.2 yacs==0.1.8 edt==2.3.2
198190
```
199191

200192
Install BiaPy:
@@ -226,12 +218,12 @@ git clone https://github.com/BiaPyX/BiaPy.git
226218
This will create a folder called ``BiaPy`` that contains all the files of the <a href="https://github.com/BiaPyX/BiaPy" target="_blank" rel="noopener noreferrer">library's official repository</a>. Then you will need to install BiaPy dependencies:
227219

228220
```bash
221+
# Install Pytorch and GPU dependencies
222+
pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu118
223+
224+
# Then install BiaPy
229225
cd BiaPy
230226
pip install --editable .
231-
232-
# Install Pytorch and GPU dependencies
233-
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu118
234-
pip install timm==1.0.14 pytorch-msssim torchmetrics[image]==1.4.*
235227
```
236228

237229
<!-- command_line_installation option 3 -->

0 commit comments

Comments
 (0)