Skip to content

Undeterministic segmentation on with different instances of model #91

Closed

Description

@Czaki

I try to create cellpose plugin to my tool https://github.com/4DNucleome/PartSeg_cellpose I found that In some scenario different instances of cellpose model returns different predictions. I try to prepare code which deterministic reproduce this, but not always next instance of model fail. I need to recreate it again in third cell to got this result.

Zrzut ekranu z 2020-06-19 10-14-23

But in my plug-in this happens always.

It is possible to fix it?

img02.png is from your example notebook.

Activity

  1. marius10p commented on Jul 3, 2020

    @marius10p
    Contributor

    Sorry, I'm not sure I understand. There should not be any randomness in that function call (right @carsen-stringer ?).

  2. Czaki commented on Jul 3, 2020

    @Czaki
    ContributorAuthor

    As I expect there should be no randomness. But I found that I got different result in notebook and in gui (my one). Then in test I found that I can reproduce this in notebook.

  3. Czaki commented on Jul 13, 2020

    @Czaki
    ContributorAuthor

    Any information?

  4. carsen-stringer commented on Aug 30, 2020

    @carsen-stringer
    Member

    In the notebook you are running with diameter=None so it is estimating the diameter for you. In the GUI are you also using the "calibration" button to get the diameter?

    I don't understand how it could be different in the same notebook with the same code, can you provide more information if you are still having this issue?

  5. Czaki commented on Sep 1, 2020

    @Czaki
    ContributorAuthor

    I don't understand how it could be different in the same notebook with the same code, can you provide more information if you are still having this issue?

    I also do not understand this. But I notice that problematic runs take much longer time (9 seconds against 90-160 seconds).
    Now it happens time to time when using multiple instances of model from notebook. It does not depend if I set diameter to None or 0 or set positive value 30.

    I do not have any idea how debug this. But maybe You have idea why wrong calculation in current version takes longer time?

  6. Czaki commented on Sep 2, 2020

    @Czaki
    ContributorAuthor

    I check this on second computer (both ubuntu) and same problem (different segmentation form different instance of model for same file) shows.

  7. chrisroat commented on Dec 1, 2020

    @chrisroat
    Contributor

    I have seen similar non-determinism in some unit tests I have, which makes them flaky. It's often on just small, isolated groups of pixels near segment boundaries. From apache/mxnet#13829 (comment), it seems that mxnet autotuning can be non-deterministic.

    Setting the following during my tests has fixed my problem:

    MXNET_CUDNN_AUTOTUNE_DEFAULT=0

  8. carsen-stringer commented on Apr 28, 2021

    @carsen-stringer
    Member

    thanks @chrisroat , closing this for now, perhaps the torch version doesn't have this problem

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

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