Skip to content

Issue when trying to run an inference on data with shape (129, 308, 461) #115

Description

@sebi06

Hi all,

I did load a 3d stack into Napari and tried to run CellSeg3D on it but I always get stuck at:

0.01s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
09:57:08 : INFO : MainThread : Starting...
09:57:08 : INFO : MainThread : ********************
09:57:08 : INFO : MainThread : Worker started at 09:57:08
09:57:08 : INFO : MainThread : Saving results to : C:\Users\m1srh\cellseg3d\inference
09:57:08 : INFO : MainThread : Worker is running...
09:57:08 : INFO : MainThread : MODEL DIMS : 64
09:57:08 : INFO : MainThread : Model name : WNet3D
09:57:08 : INFO : MainThread : Instantiating model...
09:57:08 : INFO : Dummy-8 : ********************
09:57:08 : INFO : MainThread : Loading weights...
09:57:08 : INFO : Dummy-8 : Weight file wnet_latest.pth already exists, skipping download
09:57:09 : INFO : MainThread : Weights status : None
09:57:09 : INFO : MainThread : Done
09:57:09 : INFO : MainThread : --------------------
09:57:09 : INFO : MainThread : Parameters summary :
09:57:09 : INFO : MainThread : Model is : WNet3D
09:57:09 : INFO : MainThread : Thresholding is enabled at 0.6
09:57:09 : INFO : MainThread : Window inference is enabled
09:57:09 : INFO : MainThread : Window size is 64
09:57:09 : INFO : MainThread : Window overlap is 0.25
09:57:09 : INFO : MainThread : Dataset loaded on cpu device
09:57:09 : INFO : MainThread : --------------------
09:57:09 : INFO : MainThread : Loading layer
09:57:09 : ERROR : Dummy-8 : dimensions ('Z', 'Y', 'X') must have the same length as the number of data dimensions, ndim=4
Traceback (most recent call last):
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\napari_cellseg3d\code_models\worker_inference.py", line 969, in inference
    input_image = self.load_layer()
                  ^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\napari_cellseg3d\code_models\worker_inference.py", line 283, in load_layer
    volume = np.reshape(volume, newshape=(1, *volume.shape))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 285, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 56, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 49, in _wrapit
    result = wrap(result)
             ^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\dataarray.py", line 4804, in __array_wrap__
    new_var = self.variable.__array_wrap__(obj, context, return_scalar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\variable.py", line 2340, in __array_wrap__
    return Variable(self.dims, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\variable.py", line 379, in __init__
    super().__init__(
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\namedarray\core.py", line 261, in __init__
    self._dims = self._parse_dimensions(dims)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\namedarray\core.py", line 505, in _parse_dimensions
    raise ValueError(
ValueError: dimensions ('Z', 'Y', 'X') must have the same length as the number of data dimensions, ndim=4
09:57:09 : INFO : MainThread :
Worker finished at 09:57:09
09:57:09 : INFO : MainThread : ********************
09:57:46 : INFO : MainThread : Starting...
09:57:46 : INFO : MainThread : ********************
09:57:46 : INFO : MainThread : Worker started at 09:57:46
09:57:46 : INFO : MainThread : Saving results to : C:\Users\m1srh\cellseg3d\inference
09:57:46 : INFO : MainThread : Worker is running...
09:57:46 : INFO : MainThread : MODEL DIMS : 64
09:57:46 : INFO : MainThread : Model name : VNet
09:57:46 : INFO : MainThread : Instantiating model...
09:57:47 : INFO : Dummy-9 : ********************
09:57:47 : INFO : MainThread : Loading weights...
09:57:47 : INFO : Dummy-9 : Downloading the model from HuggingFace https://huggingface.co/C-Achard/cellseg3d/resolve/main/VNet_latest.tar.gz....
09:57:58 : INFO : MainThread : Weights status : <All keys matched successfully>
09:57:58 : INFO : MainThread : Done
09:57:58 : INFO : MainThread : --------------------
09:57:58 : INFO : MainThread : Parameters summary :
09:57:58 : INFO : MainThread : Model is : VNet
09:57:58 : INFO : MainThread : Thresholding is enabled at 0.15
09:57:58 : INFO : MainThread : Window inference is enabled
09:57:58 : INFO : MainThread : Window size is 64
09:57:58 : INFO : MainThread : Window overlap is 0.25
09:57:58 : INFO : MainThread : Dataset loaded on cpu device
09:57:58 : INFO : MainThread : --------------------
09:57:58 : INFO : MainThread : Loading layer
09:57:58 : ERROR : Dummy-9 : dimensions ('Z', 'Y', 'X') must have the same length as the number of data dimensions, ndim=4
Traceback (most recent call last):
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\napari_cellseg3d\code_models\worker_inference.py", line 969, in inference
    input_image = self.load_layer()
                  ^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\napari_cellseg3d\code_models\worker_inference.py", line 283, in load_layer
    volume = np.reshape(volume, newshape=(1, *volume.shape))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 285, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 56, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\numpy\core\fromnumeric.py", line 49, in _wrapit
    result = wrap(result)
             ^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\dataarray.py", line 4804, in __array_wrap__
    new_var = self.variable.__array_wrap__(obj, context, return_scalar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\variable.py", line 2340, in __array_wrap__
    return Variable(self.dims, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\core\variable.py", line 379, in __init__
    super().__init__(
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\namedarray\core.py", line 261, in __init__
    self._dims = self._parse_dimensions(dims)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Documents\anaconda3\envs\napari-env\Lib\site-packages\xarray\namedarray\core.py", line 505, in _parse_dimensions
    raise ValueError(
ValueError: dimensions ('Z', 'Y', 'X') must have the same length as the number of data dimensions, ndim=4
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions