brainglobe / cellfinder

Automated 3D cell detection in very large images
https://brainglobe.info/documentation/cellfinder/index.html
BSD 3-Clause "New" or "Revised" License
181 stars 39 forks source link

Moved force cpu into cellfinder function #430

Closed IgorTatarnikov closed 5 months ago

IgorTatarnikov commented 5 months ago

Before submitting a pull request (PR), please read the contributing guide.

Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)

Description

What is this PR

Why is this PR needed? Tests in brainglobe-workflows fail on macos-latest as they attempt to run using mps which is not available on github runners even though torch.backends.mps.is_available() returns True.

What does this PR do? Moves the logic for forcing PyTorch to use the cpu as the device into the cellfinder package. This will hopefully allow the fix from this repo to generalise to brainglobe-workflows.

How has this PR been tested?

Tested on CI (only place I can reproduce this issue).

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist: