MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Use nn.function.one_hot for one_hot calulcation

Open rabinadk1 opened this issue 3 years ago • 4 comments

Description

Use nn.function.one_hot for one_hot calulcation in utils

Status

Ready

Types of changes

  • [x] Non-breaking change (fix or new feature that would not break existing functionality).
  • [ ] Breaking change (fix or new feature that would cause existing functionality to change).
  • [ ] New tests added to cover the changes.
  • [x] Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • [x] Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • [x] In-line docstrings updated.
  • [ ] Documentation updated, tested make html command in the docs/ folder.

rabinadk1 avatar Jun 24 '22 04:06 rabinadk1

I got the following error with make html.

writing output... [  3%] api                                                                                                                                            
Theme error:
An error happened in rendering the page api.
Reason: TypeError('quote_from_bytes() expected bytes')
make: *** [Makefile:23: html] Error 2

rabinadk1 avatar Jun 24 '22 05:06 rabinadk1

Hi @wyli ,

Do you have any idea about the doc error?

Thanks.

Nic-Ma avatar Jun 25 '22 02:06 Nic-Ma

Hi @rabinadk1 ,

Please take a look at the CI tests in this PR, I see the make html is: build succeeded. Maybe something wrong in your local environment?

Thanks.

Nic-Ma avatar Jul 08 '22 03:07 Nic-Ma

the previous change of this was because of efficiency https://github.com/Project-MONAI/MONAI/pull/486, is this PR verified for the same?

wyli avatar Jul 08 '22 13:07 wyli

the version with nn.functional.one_hot was much slower if someone can retest it (time it for 3D images) , we could consider the change but I see now reason to change it

myron avatar Oct 10 '22 04:10 myron

Current version seems to be faster.

rabinadk1 avatar Oct 10 '22 13:10 rabinadk1