Example #1
0
    def run(self, args):
        """
        Run the challenge mode
        """
        route_indexer = RouteIndexer(args.routes, args.scenarios, args.repetitions)

        if args.resume:
            route_indexer.resume(args.checkpoint)
            self.statistics_manager.resume(args.checkpoint)
        else:
            self.statistics_manager.clear_record(args.checkpoint)
            route_indexer.save_state(args.checkpoint)

        while route_indexer.peek():
            # setup
            config = route_indexer.next()

            # run
            self._load_and_run_scenario(args, config)

            route_indexer.save_state(args.checkpoint)

        # save global statistics
        print("\033[1m> Registering the global statistics\033[0m")
        global_stats_record = self.statistics_manager.compute_global_statistics(route_indexer.total)
        StatisticsManager.save_global_record(global_stats_record, self.sensor_icons, route_indexer.total, args.checkpoint)
Example #2
0
    def run(self, args, customized_data):
        """
        Run the challenge mode
        """
        route_indexer = RouteIndexer(args.routes, args.scenarios,
                                     args.repetitions)
        if args.resume:
            route_indexer.resume(self.save_path)
            self.statistics_manager.resume(self.save_path)
        else:
            self.statistics_manager.clear_record(self.save_path)
        while route_indexer.peek():
            # setup
            config = route_indexer.next()
            # run
            self._load_and_run_scenario(args, config, customized_data)
            self._cleanup(ego=True)

            route_indexer.save_state(self.save_path)
        # save global statistics
        # modification
        global_stats_record = self.statistics_manager.compute_global_statistics(
            route_indexer.total)
        StatisticsManager.save_global_record(global_stats_record, self.sensors,
                                             self.save_path)
    def run(self, args, filename, data_folder, route_folder, model_path):
        """
        Run the challenge mode
        """
        route_indexer = RouteIndexer(args.routes, args.scenarios,
                                     args.repetitions, route_folder)
        if args.resume:
            route_indexer.resume(args.checkpoint)
            self.statistics_manager.resume(args.checkpoint)
        else:
            self.statistics_manager.clear_record(args.checkpoint)
            k = 0
        while route_indexer.peek():
            #x = time.time()
            k += 1
            # setup
            config = route_indexer.next()
            # run
            self._load_and_run_scenario(args, config, data_folder,
                                        route_folder, k, model_path)

            self._cleanup(ego=True)

            route_indexer.save_state(args.checkpoint)

            # save global statistics
            global_stats_record, route_in_km = self.statistics_manager.compute_global_statistics(
                route_indexer.total)
            StatisticsManager.save_global_record(global_stats_record,
                                                 route_in_km, self.sensors,
                                                 args.checkpoint, filename,
                                                 config)
    def run(self, args):
        """
        Run the challenge mode
        """
        # agent_class_name = getattr(self.module_agent, 'get_entry_point')()
        # self.agent_instance = getattr(self.module_agent, agent_class_name)(args.agent_config)

        route_indexer = RouteIndexer(args.routes, args.scenarios, args.repetitions)

        if args.resume:
            route_indexer.resume(args.checkpoint)
            self.statistics_manager.resume(args.checkpoint)
        else:
            self.statistics_manager.clear_record(args.checkpoint)
            route_indexer.save_state(args.checkpoint)

        while route_indexer.peek():
            # setup
            config = route_indexer.next()

            # run
            self._load_and_run_scenario(args, config)

            for obj in gc.get_objects():
                try:
                    if torch.is_tensor(obj) or (hasattr(obj, 'data') and torch.is_tensor(obj.data)):
                        print(type(obj), obj.size())
                except:
                    pass

            route_indexer.save_state(args.checkpoint)

        # save global statistics
        print("\033[1m> Registering the global statistics\033[0m")
        global_stats_record = self.statistics_manager.compute_global_statistics(route_indexer.total)
        StatisticsManager.save_global_record(global_stats_record, self.sensor_icons, route_indexer.total, args.checkpoint)