Installation#
CAREamics is a deep-learning library and we therefore recommend having GPU support as training the algorithms on the CPU can be very slow.
We recommend using mamba (miniforge) to install all packages in a virtual environment. As an alternative, you can use conda (miniconda) with the same commands (replacing mamba
by conda
).
For macOS silicon-acceleration, please refer to the specific sections!
CAREamics library step-by-step#
This section install CAREamics for use in your own library or tool, via jupyter notebook or as scripts. For the napari plugin, refer to the next section.
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
-
Verify that the GPU is available:
python -c "import torch; print([torch.cuda.get_device_properties(i) for i in range(torch.cuda.device_count())])"
This should show a list of available GPUs. If the list is empty, then you will need to change the
pytorch
andpytorch-cuda
versions to match your hardware (linux and windows). -
Install CAREamics. We have several extra options (
dev
,examples
,wandb
andtensorboard
). If you wish to run the example notebooks, we recommend the following:
These instructions were tested on a linux virtual machine (RedHat 8.6) with a NVIDIA A40-8Q GPU.
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
Note that this will probably not install silicon GPU acceleration. If you want GPU acceleration, please refer to the relevant section to ensure that you install packages for the correct platform.
-
Install CAREamics. We have several extra options (
dev
,examples
,wandb
andtensorboard
). If you wish to run the example notebooks, we recommend the following:
Extra dependencies#
CAREamics extra dependencies can be installed by specifying them in brackets. In the previous section we installed careamics[examples]
. You can add other extra dependencies, for instance wandb
by doing:
Here is a list of the extra dependencies:
examples
: Dependencies required to run the example notebooks.wandb
: Dependencies to use WandB as a logger.tensorboard
: Dependencies to use TensorBoard as a logger.dev
: Dependencies required to run all the tooling necessary to develop with CAREamics.
MacOS silicon GPU#
- Open the terminal and type
conda
to verify that conda is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
-
Verify that GPU is available:
python -c "import torch; import platform; print((platform.processor() in ('arm', 'arm64') and torch.backends.mps.is_available()))"
If this prints
False
, make sure that you do have an M1, M2 or M3 chip, and that theconda
/mamba
macOS-arm64 release was installed correctly. -
Install CAREamics. We have several extra options (
dev
,examples
,wandb
andtensorboard
). If you wish to run the example notebooks, we recommend the following:
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
-
Verify that GPU is available:
python -c "import torch; import platform; print((platform.processor() in ('arm', 'arm64') and torch.backends.mps.is_available()))"
If this prints
False
, make sure that you do have an M1, M2 or M3 chip, and that theconda
/mamba
macOS-arm64 release was installed correctly. -
Install CAREamics. We have several extra options (
dev
,examples
,wandb
andtensorboard
). If you wish to run the example notebooks, we recommend the following:
Quickstart#
Once you have installed CAREamics, the easiest way to get started is to look at the applications for full examples and the guides for in-depth tweaking.
CAREamics napari plugin#
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
-
Verify that the GPU is available:
python -c "import torch; print([torch.cuda.get_device_properties(i) for i in range(torch.cuda.device_count())])"
This should show a list of available GPUs. If the list is empty, then you will need to change the
pytorch
andpytorch-cuda
versions to match your hardware (linux and windows). -
Install CAREamics napari plugin and napari:
These instructions were tested on a linux virtual machine (RedHat 8.6) with a NVIDIA A40-8Q GPU.
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
Note that this will probably not install silicon GPU acceleration. If you want GPU acceleration, please refer to the relevant section to ensure that you install packages for the correct platform.
-
Install CAREamics napari plugin and napari:
MacOS silicon GPU#
- Open the terminal and type
conda
to verify that conda is available. -
Create a new environment:
-
Install PyTorch following the official instructions
As an example, our test machine requires:
-
Verify that GPU is available:
python -c "import torch; import platform; print((platform.processor() in ('arm', 'arm64') and torch.backends.mps.is_available()))"
If this prints
False
, make sure that you do have an M1, M2 or M3 chip, and that theconda
/mamba
macOS-arm64 release was installed correctly. -
Install CAREamics napari plugin and napari:
- Open the terminal and type
mamba
to verify that mamba is available. -
Create a new environment:
-
Install PyTorch following the official instructions while specifying the platform. As an example, our test machine requires:
-
Verify that GPU is available:
python -c "import torch; import platform; print((platform.processor() in ('arm', 'arm64') and torch.backends.mps.is_available()))"
If this prints
False
, make sure that you do have an M1, M2 or M3 chip, and that theconda
/mamba
macOS-arm64 release was installed correctly. -
Install CAREamics napari plugin and napari: