Skip to content

Index error when training Omnipose in colab #380

@XinChen1020

Description

@XinChen1020

I want to training a Omnipose based on my own dataset on colab but it keeps giving me index error

2021-11-21 17:14:46,035 [INFO] WRITING LOG OUTPUT TO /root/.cellpose/run.log
2021-11-21 17:14:48,953 [INFO] ** TORCH CUDA version installed and working. **
2021-11-21 17:14:48,953 [INFO] >>>> using GPU
2021-11-21 17:14:48,953 [INFO] >>>> Omnipose enabled. See https://raw.githubusercontent.com/MouseLand/cellpose/master/cellpose/omnipose/license.txt for licensing details.
2021-11-21 17:14:49,097 [INFO] >>>> training from scratch
2021-11-21 17:14:49,097 [INFO] >>>> during training rescaling images to fixed diameter of 30.0 pixels
2021-11-21 17:14:49,174 [INFO] Training with rescale = 1.00
2021-11-21 17:14:49,346 [INFO] train channels = 2
2021-11-21 17:14:49,363 [INFO] test channels = 2
2021-11-21 17:14:49,363 [INFO] flows precomputed
2021-11-21 17:14:49,404 [INFO] flows precomputed
2021-11-21 17:14:49,409 [INFO] >>> Using RAdam optimizer
2021-11-21 17:14:49,547 [INFO] >>>> median diameter set to = 30
2021-11-21 17:14:49,547 [INFO] >>>> training network with 2 channel input <<<<
2021-11-21 17:14:49,547 [INFO] >>>> saving every 100 epochs
2021-11-21 17:14:49,547 [INFO] >>>> LR: 0.00020, batch_size: 2, weight_decay: 0.00001
2021-11-21 17:14:49,547 [INFO] >>>> ntrain = 58
2021-11-21 17:14:49,547 [INFO] >>>> rescale is 1
2021-11-21 17:14:49,547 [INFO] >>>> ntest = 6
2021-11-21 17:14:49,547 [INFO] (2, 258, 252)
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/dist-packages/cellpose/main.py", line 436, in
main()
File "/usr/local/lib/python3.7/dist-packages/cellpose/main.py", line 415, in main
batch_size=args.batch_size, omni=args.omni)
File "/usr/local/lib/python3.7/dist-packages/cellpose/models.py", line 850, in train
batch_size, rescale)
File "/usr/local/lib/python3.7/dist-packages/cellpose/core.py", line 930, in _train_net
rescale=rsc, scale_range=scale_range, unet=self.unet, inds=inds, omni=self.omni)
File "/usr/local/lib/python3.7/dist-packages/cellpose/transforms.py", line 659, in random_rotate_and_resize
xy=xy, do_flip=do_flip, rescale=rescale, inds=inds)
File "/usr/local/lib/python3.7/dist-packages/cellpose/omnipose/core.py", line 324, in random_rotate_and_resize
inds is None if inds is None else inds[n], dist_bg)
File "/usr/local/lib/python3.7/dist-packages/cellpose/omnipose/core.py", line 434, in random_crop_warp
lbl[k] = cv2.warpAffine(labels[k], M, (xy[1],xy[0]), borderMode=mode, flags=method)
IndexError: index 6 is out of bounds for axis 0 with size 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions