Change HoVerNet Model Output from Dict to Tensor
See original GitHub issueHoVerNet model has three branches and currently each of them are being return with an associated key and all together as a dictionary. This approach is nice since we know what branch we are dealing with with the Enum
s that are defined; however, it is creating some challenges since this kind of outputs is not common in MONAI, and requires some changes:
- HoVerNet Loss function needs to accept dictionary of Tensors (instead of one Tensor) for prediction and target (https://github.com/Project-MONAI/MONAI/pull/5199)
- a new PrepareBatch is need to extract all the keys for the target and return a dictionary for target (instead of a tensor)
- SuperviseTrainer needs to be updated to accept dictionary as the model outputs
- Post process Transforms should implement new additional keys (https://github.com/Project-MONAI/MONAI/pull/5186#discussion_r981308312)
Considering that with this simple change, there is no need for any of the above changes, I am leaning toward making this backward incompatibility and making HoVerNet outputs a tensor where each channel represents output of one branch:
- first channel: nuclei segmentation (NP branch)
- second channel: horizontal map (HV branch)
- third channel: vertical map (HV branch)
- fourth channel (and any additional channel): classification output (NC branch)
@wyli @Nic-Ma @ericspod @rijobro @JHancox What do you think?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Change HoVerNet Model Output from Dict to Tensor - PullAnswer
HoVerNet model has three branches and currently each of them are being return with an associated key and all together as a dictionary....
Read more >Training an ML Model (HoVer-Net) - PathML's documentation!
In this notebook, we will train HoVer-Net model to perform nucleus detection and classification, using data from PanNuke dataset.
Read more >Use dictionary on tensor - python - Stack Overflow
I have my data on a tf.record and dont want to create one everytime I change classes, so trying to modify it in...
Read more >Issue running code · Issue #12 · vqdang/hover_net - GitHub
I am facing the error of FilenotfoundError for the stats.json file while running the infer.py file. Do I need to train the model...
Read more >Convert texts into tensors for Deep Learning - Medium
A simple template to convert textual data into tensor format ... conversion of terms in the dictionary into tensors ... The output will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Nic-Ma, thanks for your questions.
However, IMO we need more motivation to make a backward incompatible change, so I close this issue, and plan for the afterward changes.
@wyli @JHancox Thanks for your feedback. I agree with @JHancox, that dictionaries are more elegant [and readable] than tuples in this case. If there is not enough motivation to make it tensor, we continue with the current implementation (dictionaries) and I will close this issue.