-
Notifications
You must be signed in to change notification settings - Fork 691
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
[Bug]: Tricky behavior when config.project.seed
is set to 0
#763
Comments
We agree with your observations, and your proposed solution sounds good. It would be great if you're willing to submit a PR for this and become a contributor. The PR could include a warning message if the value of the seed is zero, explaining that the behavior has changed for this seed value. I think the most appropriate place for this warning message would be inside the get_configurable_parameters function, which is responsible for parsing the |
Thanks, then I will submit a pull request with a modified code and a warning message. But it seems the branch named |
@djdameln It seems I don't have permission to push my branch to create a pull request. |
@tanemaki, you'll probably need to create a fork, from which you could create the pull request. |
@samet-akcay Oh, I see! Thanks for the comment :) Ah, it is stated in the contributing guideline, which I completely forgot to read in the first place. It's my bad. |
@tanemaki, no problem at all |
Because I could not pass the test on my environment, I have created a draft pull request to share my code change :) |
I have created a fork repository, but it seems the test ( Here are the steps to produce test failure.
will produce the following output.
|
@tanemaki, the PR seems to pass in our CI tests. |
@samet-akcay Oh, really? Thanks for letting me know. Then, do I need to press "Ready for review" button to convert the draft PR to the formal PR? |
Yes please |
Describe the bug
Hi,
Thanks for the great work :) I have just encountered unexpected behavior in seed specification, so here is the issue description.
In the current implementation, when
config.project.seed
is set to0
, a seed is not fixed to 0 but randomized, as shown in the following code:anomalib/tools/train.py
Lines 50 to 51 in 764f97d
anomalib/tools/hpo/sweep.py
Lines 38 to 39 in 764f97d
I feel that the seed should be randomized either
seed
key underconfig.project
, orconfig.project.seed
is explicitly set toNone
.So how about rewriting the above code as follows?
If this change doesn't bother somebody who already uses 0 to randomize seeds, I will create a pull request.
What do you think?
Dataset
N/A
Model
N/A
Steps to reproduce the behavior
python tools/train.py --model patchcore
The seed is set to 0 in patchcore's
config.yaml
, so the seed is randomized.anomalib/anomalib/models/patchcore/config.yaml
Line 54 in 764f97d
OS information
OS information:
Expected behavior
When a seed is set to 0, the seed should be fixed to 0 instead of using a random seed.
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
No response
Configuration YAML
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: