melodic-market-69755
08/21/2023, 8:16 AMself.next(self.run_model, foreach='local_original_video_filenames') where run_model flow run the inference over the video and local_original_video_filenames is a list with local video urls.ambitious-bird-15073
08/21/2023, 8:43 AM--max-workers but that is set to 16 by default. So I am guessing its an issue with the compute you are using.melodic-market-69755
08/21/2023, 8:45 AMambitious-bird-15073
08/21/2023, 8:46 AMmelodic-market-69755
08/21/2023, 8:46 AMambitious-bird-15073
08/21/2023, 8:48 AMmelodic-market-69755
08/21/2023, 8:50 AMmelodic-market-69755
08/21/2023, 8:51 AMfor index, name in enumerate(videos):
process = Process(
target=task.detectObject,
args=(name, str(name), model, output_videos[index], LINE_START, LINE_END, CONF, False)
)
process.start()
processes.append(process)
for process in processes:
process.join()ambitious-bird-15073
08/21/2023, 8:52 AMbatch_size=1 on a GPU. Remove the use of the foreach and load the data with a bigger batch_size.melodic-market-69755
08/21/2023, 9:24 AMambitious-bird-15073
08/21/2023, 11:33 AMfrom metaflow import FlowSpec, step
class SampleFlow(FlowSpec):
@step
def start(self):
self.videos = ...
self.next(self.a)
@step
def process_videos(self):
process_videos(self.videos)
self.next(self.end)
@step
def end(self):
...
if __name__ == "__main__":
SampleFlow()
When you do not have enough workers to perform a foreach you are essentially doing a for loop across each video and processing them sequentially:
[process(video) for each video in videos]melodic-market-69755
08/21/2023, 11:35 AM