Skip to content

Installation Update#43

Merged
mese79 merged 12 commits into
mainfrom
ms/update/setup
May 29, 2025
Merged

Installation Update#43
mese79 merged 12 commits into
mainfrom
ms/update/setup

Conversation

@mese79
Copy link
Copy Markdown
Member

@mese79 mese79 commented May 24, 2025

I changed the setup process by utilizing an installation script (install.sh and install.bat).

#! /bin/sh
# This script will install FeatureForest and its dependencies in a new conda environment.
echo "\nCreate a new conda environment named featureforest with Python 3.10"
conda init
conda create -n featureforest -y python=3.10
echo "\nActivate the featureforest environment"
source activate base
conda activate featureforest
echo "\nInstall PyTorch and torchvision using light-the-torch"
python -m pip install light-the-torch
ltt install 'torch>=2.5.1' 'torchvision>=0.20.1'
echo "\nInstall additional dependencies"
python -m pip install -r ./requirements.txt
echo "\nInstall FeatureForest from GitHub"
python -m pip install git+https://github.com/juglab/featureforest.git

To install PyTorch, this script is using light-the-torch package that can automatically detect local installation of CUDA and its version. Also, segmenta-anything and sam-2 will be installed from their git repos.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.85%. Comparing base (ba22200) to head (8303bbf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #43   +/-   ##
=======================================
  Coverage   24.85%   24.85%           
=======================================
  Files          40       40           
  Lines        2394     2394           
=======================================
  Hits          595      595           
  Misses       1799     1799           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mese79 mese79 requested review from jdeschamps and veegalinova May 24, 2025 17:14
@jdeschamps
Copy link
Copy Markdown
Member

jdeschamps commented May 26, 2025

Oh that's an interesting one! Does it work for metal/macOS or just nvidia systems?

Comment thread install.sh
echo "\nInstall additional dependencies"
python -m pip install -r ./requirements.txt
echo "\nInstall FeatureForest from GitHub"
python -m pip install git+https://github.com/juglab/featureforest.git
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not the pip package?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean why not pip install -r ./requirements.txt ?
Unfortunately, CI test on Windows fails on:
pip install light-the-torch
Because current light-the-torch supports an older version of pip and trying to down(up)grad the pip will throw an error. But with python -m pip install light-the-torch everything's fine.
So I decided tobe safe and used python -m pip everywhere!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I meant why install git+https://github.com/juglab/featureforest.git rather than the Pip package!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I guess because the git repo is usually more up-to-date.

@mese79
Copy link
Copy Markdown
Member Author

mese79 commented May 26, 2025

Oh that's an interesting one! Does it work for metal/macOS or just nvidia systems?

I tried on Mac and it installs the CPU version. Although I'm not sure how can I check if it has MPS accelerator!

@jdeschamps
Copy link
Copy Markdown
Member

Oh that's an interesting one! Does it work for metal/macOS or just nvidia systems?

I tried on Mac and it installs the CPU version. Although I'm not sure how can I check if it has MPS accelerator!

Like this: https://github.com/CAREamics/careamics/blob/d863507c08a5fc72966caa9800407b0160d4cd80/src/careamics/transforms/n2v_manipulate_torch.py#L83

Annoying but these are the two conditions validating that MPS is usable.

@mese79 mese79 merged commit 5183db5 into main May 29, 2025
4 checks passed
@mese79
Copy link
Copy Markdown
Member Author

mese79 commented May 30, 2025

Using light-the-torch to install PyTorch on Mac, the torch.backends.mps.is_available() returns True.

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

Successfully merging this pull request may close these issues.

3 participants