Skip to content

Add support for <=PyTorch1.9.1#5467

Merged
bhashemian merged 6 commits intoProject-MONAI:devfrom
JHancox:dev
Nov 4, 2022
Merged

Add support for <=PyTorch1.9.1#5467
bhashemian merged 6 commits intoProject-MONAI:devfrom
JHancox:dev

Conversation

@JHancox
Copy link
Copy Markdown
Contributor

@JHancox JHancox commented Nov 3, 2022

Fixes #5469

Description

For CrossEntropy, PyTorch v1.10+ allows target values to be either class probabilities or indices, whereas v1.9- only allows for class indices, so class indices are now used. This should provide a better solution for #5393 and remove the need for #5401

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).

For CrossEntropy, PyTorch v1.10+ allows target values to be either class probabilities or indices, whereas v1.9- only allows for class indices, so class indices are now used. This should provide a better solution for Project-MONAI#5393 and remove the need for Project-MONAI#5401

Signed-off-by: JHancox <[email protected]>
@bhashemian bhashemian requested a review from Nic-Ma November 4, 2022 14:33
@bhashemian bhashemian enabled auto-merge (squash) November 4, 2022 14:33
@bhashemian bhashemian requested a review from wyli November 4, 2022 15:49
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Nov 4, 2022

/build

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Nov 4, 2022

/build

@bhashemian bhashemian merged commit 27362e4 into Project-MONAI:dev Nov 4, 2022
wyli pushed a commit that referenced this pull request Nov 6, 2022
Fixes #5469  

### Description

For CrossEntropy, PyTorch v1.10+ allows target values to be either class
probabilities or indices, whereas v1.9- only allows for class indices,
so class indices are now used. This should provide a better solution for
#5393 and remove the need for #5401


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).

Signed-off-by: JHancox <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Co-authored-by: Behrooz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make HoVerNetLoss to work with PyTorch<1.10

3 participants