-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Es/anomaly hpo save model bug fix #1315
Conversation
run ote-test |
4892b19
to
ecc636b
Compare
run ote-test |
Could you run some local HPO tests for Anomaly tasks? |
@ashwinvaidya17 This PR is same with [this PR](https://github.com/openvinotoolkit/training_extensions/pull/1300, but for develop branch. |
Ok I'm checking now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. But I think you need to update _set_metadata
as well.
def _set_metadata(self, output_model: ModelEntity):
if hasattr(self.model, "image_threshold"):
output_model.set_data("image_threshold", self.model.image_threshold.value.cpu().numpy().tobytes())
if hasattr(self.model, "pixel_threshold"):
output_model.set_data("pixel_threshold", self.model.pixel_threshold.value.cpu().numpy().tobytes())
if hasattr(self.model, "normalization_metrics"):
output_model.set_data("min", self.model.normalization_metrics.state_dict()["min"].cpu().numpy().tobytes())
output_model.set_data("max", self.model.normalization_metrics.state_dict()["max"].cpu().numpy().tobytes())
else:
logger.warning(
"The model was not trained before saving. This will lead to incorrect normalization of the heatmaps."
)
I checked that any errors didn't arise when run anomaly task with HPO. |
@ashwinvaidya17 Thank you for comment. |
I see. then, I'll revert it. |
run ote-test |
This PR solves bug that error raises when run HPO on anomaly tasks.
It's same with previous one but for OTX and Geti's develop branch.