Closed PyJulie closed 8 months ago
Could you include more info, for example what were you running/calling when seeing this error? self.threshold
is set in https://github.com/Jingkang50/OpenOOD/blob/63e0c7990221fe4c1141b77df3f20d207af8580b/openood/postprocessors/react_postprocessor.py#L47-L52, which should be automatically taken care of if you use our evaluation pipeline or api.
I just followed the provided script and run it. It seems that set_hyperapram did not initially work before postprocess function?
Were you running without APS mode? If so, I might know what's the problem.
@PyJulie Can you try again with the new commit?
Hi, I was truly running in APS mode.
I found that
line 118 postprocessor.setup works before line 157 self.hyperparam_search().
Unfortunately, new commit may not work either since self.activation_log should be pre-defined.
I added it into def postprocess(self, net: nn.Module, data: Any) function,
and the codes ran successfully but I am not sure if I got the expected results.
I will further try to solve this issue and pull a commit.
Thank you!
If you were running in APS mode then that's weird because during hyperparameter search the evaluator will call set_hyperparam
which in turn sets self.threshold
for react. Without APS mode indeed it was a bug that self.threshold
was missing.
Yep, it is quiet weird since I did not get bugs when I was running other methods with the requirements of APS mode.
But I checked my .yml config and training log, which shos the APS mode is on:
File "/mnt/sda/julie/projects/OSR/OpenOOD-main/OpenOOD-main/openood/postprocessors/react_postprocessor.py", line 41, in postprocess output = net.forward_threshold(data, self.threshold) AttributeError: 'ReactPostprocessor' object has no attribute 'threshold'