From 10fc5f36578c8d1168de274c2d37235a1de6d45f Mon Sep 17 00:00:00 2001 From: maturk Date: Mon, 26 Jun 2023 15:21:13 +0300 Subject: [PATCH] explicitly catch full queue, notify of other exceptions --- nerfstudio/data/datamanagers/parallel_datamanager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nerfstudio/data/datamanagers/parallel_datamanager.py b/nerfstudio/data/datamanagers/parallel_datamanager.py index 57fdac1ca..1b95c9678 100644 --- a/nerfstudio/data/datamanagers/parallel_datamanager.py +++ b/nerfstudio/data/datamanagers/parallel_datamanager.py @@ -3,6 +3,7 @@ from __future__ import annotations import concurrent.futures import functools import time +import queue from abc import abstractmethod from collections import defaultdict from dataclasses import dataclass, field @@ -108,8 +109,11 @@ class DataProc(mp.Process): try: self.out_queue.put_nowait((ray_bundle, batch)) break - except: - time.sleep(0.001) + except queue.Full: + time.sleep(0.0001) + except Exception: + CONSOLE.print_exception() + CONSOLE.print("[bold red]Error: Error occured in parallel datamanager queue.") def cache_images(self): # caches all the input images in a NxHxWx3 tensor