ADS-Testing / SAMOTA

Replication of "(ICSE 22) Efficient Online Testing for DNN-based Systems using Surrogate-Assisted and Many-Objective Optimization"
MIT License
1 stars 1 forks source link

Unable to build surrogate models #8

Closed rsomers1998 closed 4 months ago

rsomers1998 commented 11 months ago

Building the RBF model of the surrogate ensemble throws the following error:

Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "run_SAMOTA_e.py", line 75, in run
    archive = minimize(Pylot_caseStudy()._evaluate, size, lb, ub, no_of_Objectives, threshold_criteria, time_budget, logger,archive,database,g_max)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/samota.py", line 355, in minimize
    run_search(func, size, lb, ub, no_of_Objectives, criteria,archive,logger,start,time_budget,database,g_max)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/samota.py", line 334, in run_search
    T_g = GS (database,objective_uncovered,size,g_max,criteria,lb,ub)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/samota.py", line 184, in GS
    M_g = train_globals(database,objective_uncovered)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/samota.py", line 129, in train_globals
    ensemble_model = ensemble(db,obj)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/ensemble.py", line 20, in __init__
    self.rbf = RBF_Model(10, train)
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/RBF.py", line 101, in __init__
    self.train(no_of_neurons,np.array(cluster))
  File "/home/ubuntu/carla/SAMOTA/implementation/runner/lib/RBF.py", line 117, in train
    self.model.add(rbflayer)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 456, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/keras/engine/sequential.py", line 193, in add
    x = input_layer.Input(
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/keras/engine/input_layer.py", line 295, in Input
    input_layer = InputLayer(**input_layer_config)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/keras/engine/input_layer.py", line 149, in __init__
    input_tensor = backend.placeholder(
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/keras/backend.py", line 1087, in placeholder
    x = array_ops.placeholder(dtype, shape=shape, name=name)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/ops/array_ops.py", line 3026, in placeholder
    return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6675, in placeholder
    _, _, _op, _outputs = _op_def_library._apply_op_helper(
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/framework/op_def_library.py", line 742, in _apply_op_helper
    op = g._create_op_internal(op_type_name, inputs, dtypes=None,
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py", line 593, in _create_op_internal
    return super(FuncGraph, self)._create_op_internal(  # pylint: disable=protected-access
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 3312, in _create_op_internal
    node_def = _NodeDef(op_type, name, attrs)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1596, in _NodeDef
    node_def.attr[k].CopyFrom(v)
  File "/home/ubuntu/miniconda3/envs/carla/lib/python3.8/site-packages/google/protobuf/internal/containers.py", line 70, in __getitem__
    return self._values[key]
TypeError: list indices must be integers or slices, not str

I'm not sure if this is possibly down to a version change causing the way tensorflow interprets the data to be different?

To replicate, add the line return 1000, 1000, 1000, 1000, 1000, 1000 at the start of runner.py#run_single_scenario