stepcount icon indicating copy to clipboard operation
stepcount copied to clipboard

Old pytorch version... update possible?

Open walkabilly opened this issue 3 months ago • 3 comments

It seems this runs on a relatively old version of pytorch (1.x). My team is working on implementing this in our workflow but are running into conflicts because of dependencies related to pytorch 2.0. Is it possible to test and release an updated version that uses at least pytorch 2.0.

walkabilly avatar Sep 18 '25 20:09 walkabilly

It's a bit tricky because some of our own workflows and of other researchers are stuck in the older torch version. I believe we can make the deps flexible (let >= instead of ==) but would require testing it. Has your team encountered any functional issues when using torch 2?

https://github.com/OxWearables/stepcount/blob/bc84e5d1820ae18ef348d25678d1118b295cea41/setup.py#L62

chanshing avatar Sep 19 '25 09:09 chanshing

We have not tried to use torch 2. We are running this on Digital Alliance Canada using the 2023 standard software environment https://docs.alliancecan.ca/wiki/Standard_software_environments#StdEnv/2023 and the default is torch 2. We can run the older 2020 standard software environment (default torch 1) and this does work for us. It's just optimized for GPU and runs everything on CPU and it's unclear on our end how long the 2020 environment will be sorted by Digital Alliance Canada. We can do some testing on our end and see what happens.

walkabilly avatar Sep 19 '25 15:09 walkabilly

Here is the report on our end. A recent torch version is fine (version 2.6) but some standard modules need to be installed with some version constraints to avoid any boring FutureWarnings. Here is the configuration used:

module load StdEnv/2023
# Stepcount need Python<3.11
module load python/3.10 scipy-stack 

# Python Env
virtualenv --no-download venv
source venv/bin/activate
pip install --no-index --upgrade pip
pip install --no-deps stepcount
pip install "numpy < 2"
pip install "pandas < 2.1.0"
pip install actipy hmmlearn imbalanced-learn joblib numba scikit-learn torchvision tqdm transforms3d

Installed stepcount with no dependancies, but had to manually installed them (last lines).

Successfully ran stepcount on CPU with this setup. And it also run in GPU mode, although it takes forever compared to the CPU mode, at least for the small file I used for my tests.

walkabilly avatar Sep 19 '25 18:09 walkabilly