Snowdar / asv-subtools

An Open Source Tools for Speaker Recognition
Apache License 2.0
587 stars 135 forks source link

发现了一个逻辑漏洞/found a bug #78

Open jjtybcb opened 7 months ago

jjtybcb commented 7 months ago

subtools/pytorch/libs/supports/utils.py line 319 这行中的方法的作用是将传入的字典与默认字典做对比,将传入字典与默认的不同的部分赋值给默认字典,然后返回默认字典。但是如果这个方法的最后两个布尔参数均为false,那么如果你传入的字典中包含了默认字典中不存在的键值,则既不会报错,也不会将不存在的键值赋值给默认字典并返回。那么你将得到一个只包含默认字段的字典,而你定义的新字段(可能是你修改了一些模型或方法,增加定义了一些新变量),将采用你在方法或模型中设定好的默认值。而你在主程序,如run****.py中定义的参数,则不会传入那些方法或模型中。

At least one of this function's last two variables which are 'force_check' and 'support_unkown' should be true. So that the function can raise an error or refine the new parameters of the individual definition for the default dictionary which will be return. Or, the params you defined in the main program such as run****.py will be not passed into the methods or classes.

希望作者能看到这条问题,并对自己的程序作出修改。