-
Notifications
You must be signed in to change notification settings - Fork 46
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
Misalignment of the Hard Example Mining interface with Sedna #136
Comments
Will this PR #133 fix this issue? |
No, #133 only fixes YAML path errors by adding The essence of the issue is that Sedna's IncrementalLearning requires a The incorrect parameter passing problem caused an AttributeError when Sedna IncrementalLearning attempted to call the |
I have figure this problem out. All we need to do is to replace the code at ianvs/core/testcasecontroller/algorithm/module/module.py Lines 110 to 117 in f2352ce
with the code below if self.url:
try:
utils.load_module(self.url)
# pylint: disable=E1134
if class_factory_type == ClassType.HEM:
func = {"method": self.name, "param":self.hyperparameters}
else:
func = ClassFactory.get_cls(
type_name=class_factory_type, t_cls_name=self.name)(**self.hyperparameters)
return func This will prevent HardExampleMining from being loaded as a class instance during Ianvs's module loading process, allowing the actual loading to be handled by Sedna's IncrementalLearning or JointInference. |
Maybe |
What happened:
The current implementation of Hard Example Mining in Incremental Learning is incorrect, causing the PCB-AoI/IncrementalLearning to fail to run.
What you expected to happen:
Fix this bug to make the hard example mining interface functional in Ianvs. #122 will also require this feature.
How to reproduce it (as minimally and precisely as possible):
You need to check the following files:
examples/pcb-aoi/incremental_learning_bench/fault detection/benchmarkingjob.yaml
examples/pcb-aoi/incremental_learning_bench/fault detection/testalgorithms/fpn/fpn_algorithm.yaml
examples/pcb-aoi/incremental_learning_bench/fault detection/testenv/testenv.yaml
.The main issue is that the
fault detection
folder needs to be added to the path.For example: The following line needs to be modified to
./examples/pcb-aoi/incremental_learning_bench/fault detection/testenv/testenv.yaml
ianvs/examples/pcb-aoi/incremental_learning_bench/fault detection/benchmarkingjob.yaml
Line 9 in f2352ce
You may also need to fix paths for
workspace
,train_url
,test_url
,initial_model_url
according to your fold structurePCB-AoI/IncrementalLearning
byThen you will see errors like below:
Anything else we need to know?:
The reason for this error is that Ianvs passed incorrect parameters for
hard_example_mining
when calling Sedna'sIncrementalLearning
interface.Ianvs's
IncrementalLearning
is implemented by introducing Sedna'sIncrementalLearning
, as shown below.ianvs/core/testcasecontroller/algorithm/paradigm/base.py
Lines 96 to 100 in f2352ce
Ianvs passes an instance of the user-defined hard_example_mining module (PCB-AoI/hard_example_mining.py is an example) into the
hard_example_mining
keyword argument of Sedna'sIncrementalLearning
.However,
hard_example_mining
in Sedna is defined as a dictionary withmethod
andparam
fields, and the correct parameters for instantiatingIncrementalLearning
are as bellow.Inside Sedna's
IncrementalLearning
, an instance of the hard_example_mining algorithm will be created using theClassFactory.get_cls()
method based on this dictionary. See details in Sedna's Source CodeAccording to the current parameter passing method of Ianvs, the
hard_example_mining
in the above code will not be None, thus triggeringhem = hard_example_mining.get("method", "IBT")
.However, we are passing a module that lacks the
get
method, which is typical of adict
. Additionally, the example does not provide any further definitions, leading to an AttributeError.The text was updated successfully, but these errors were encountered: