Closed mrdandelion6 closed 1 month ago
Ouch, that spelling mistake on my part! They do crop up everywhere...
How exciting! This is the first time I have seen anyone try to use that code. And as it turns out, I made some changes to the eval loop (handling dims, channels, etc) that messed up the do_3D
branch. I just pushed the changes to fix that and tested with that notebook. Works great on GPU.
@mrdandelion6 closing now, please reopen if you have any further issues.
I am trying to segment 3D tiff cell images with Omnipose but am running into a shape mismatch error. I am following the example code on the Omnipose documentation and have even tested with the same file they used. Note that I am not testing 3D Omnipose models, but rather 2D Cellpose models with
do_3D=True
andomni=True
.This is the start of the guide I am following on the Omnipose docs.
Task
Want to be able to segment 3D tiff files using Omnipose mask building but with Cellpose 2D models.
The Error:
When I attempt to segment 3D images using Omnipose's 2D cellpose models (by setting do_3D=True and omni=True), I get a shape mismatch error. Particularly, I am forced to configure the model with
nclasses=3
even though they didnclasses=2
in the documentation example. I am forced to do this because I get a separate error otherwise (more on that below). As such, I believe this is the root cause of the shape mismatch error I am experiencing. The error occurs when callingmodel.eval
. Here is the last part of the error message:Here is a link to a txt file with the full error message.
Note that my code is identical to the Omnipose documentation example for 3D segmentation with
do_3D
aside from two things. First, I have setgpu=True
instead ofgpu=False
in my model configuration. Second, I havenclasses=3
instead ofnclasses=2
in my model configuration. This is because when I setnclasses=2
, I get a separate error:You can see the full error I get when setting
nclasses=2
at this link. Note that this error only occurs whengpu=True
is set. When I havegpu=False
, I get a similar output but it does not produce an error:Then my only choice seems to be having
nclasses=3
, as I want to use my gpu. Here are the lines of code which generate the shape mismatch error when I configure the model whennclasses=3
.You can see the full code for the above snippet here.
I have played around with the parameters for both model configuration and the
model.eval
function but have not been able to resolve the issue.Specification
I am running the script remotely on Narval clusters with Omnipose 0.4.4. I am using CUDA 11.8 and Python 3.10.2. The OS is Gentoo Base System release 2.6 provided the Narval clusters. Here are the GPUs I am using on the cluster:
Note that I am using a virtual environment instead of Conda. The compute nodes I am using do not allow Conda. Here is the result of running
pip list
, showing all my installed dependencies.Thank you,