EXCEPTION of type 'IndexError' occurred with message: tuple index out of range
krisbock opened this issue · 1 comments
Environment created as per Option2 instructions. Running creditcard with art framework. Following instructions from Webinar-Demo-2.
creditfraud> setg debug true
debug - was: False
now: True
creditfraud>boundary> scan -n 3 --log
[+] Running these attacks 3x each:
boundary, zoo, hop_skip_jump
[+] Using boundary 60fb175a
Traceback (most recent call last):
File "/home/krbock/anaconda3/envs/counterfit/lib/python3.7/site-packages/cmd2/cmd2.py", line 2063, in onecmd_plus_hooks
stop = self.onecmd(statement, add_to_history=add_to_history)
File "/home/krbock/anaconda3/envs/counterfit/lib/python3.7/site-packages/cmd2/cmd2.py", line 2493, in onecmd
stop = func(statement)
File "/home/krbock/anaconda3/envs/counterfit/lib/python3.7/site-packages/cmd2/decorators.py", line 318, in cmd_wrapper
return func(*args_list, **kwargs)
File "/home/krbock/GitHub/counterfit/counterfit/commands/scan.py", line 166, in do_scan
func(self, args)
File "/home/krbock/GitHub/counterfit/counterfit/commands/scan.py", line 149, in scan_attacks_on_active_target
perform_attacks_on_target(self, attacks, num_iters, has_logging_enabled, has_verbose_enabled, set_params, class_summary)
File "/home/krbock/GitHub/counterfit/counterfit/commands/scan.py", line 105, in perform_attacks_on_target
CFState.get_instance().active_target.run_attack(logging=has_logging_enabled)
File "/home/krbock/GitHub/counterfit/counterfit/core/targets.py", line 194, in run_attack
resulting_samples = self._run_attack(logging) # call the specific method
File "/home/krbock/GitHub/counterfit/counterfit/core/targets.py", line 266, in _run_attack
return self._run_art_attack(logging)
File "/home/krbock/GitHub/counterfit/counterfit/core/targets.py", line 256, in _run_art_attack
self.active_attack.samples, [self.active_attack.target_class] * len(self.active_attack.samples)
File "/home/krbock/anaconda3/envs/counterfit/lib/python3.7/site-packages/art/attacks/attack.py", line 75, in replacement_function
return fdict[func_name](self, *args, **kwargs)
File "/home/krbock/anaconda3/envs/counterfit/lib/python3.7/site-packages/art/attacks/evasion/boundary.py", line 128, in generate
if y is not None and self.estimator.nb_classes == 2 and y.shape[1] == 1:
IndexError: tuple index out of range
EXCEPTION of type 'IndexError' occurred with message: tuple index out of range
Looks like a shape issue - make sure the creditcard fraud model has 2 model_output_classes
. If so, the second most likely issue is that when you use scan
it chooses random parameters, except we don't check if those values are within a particular bound (silly I know).
If you run this say, 10 times, do you get the same error every time?