update debug for deploment
This commit is contained in:
parent
45222fdd06
commit
be44e6214a
@ -215,22 +215,42 @@ class PipelineStage:
|
||||
timeout_start = time.time()
|
||||
while time.time() - timeout_start < 5.0: # 5 second timeout
|
||||
result = self.multidongle.get_latest_inference_result(timeout=0.1)
|
||||
# Check if result is not None and not an empty dict/tuple
|
||||
print(f"[Stage {self.stage_id}] Got result from MultiDongle: {result}")
|
||||
|
||||
# Check if result is valid (not None, not (None, None))
|
||||
if result is not None:
|
||||
if isinstance(result, dict):
|
||||
if result: # Non-empty dict
|
||||
if isinstance(result, tuple) and len(result) == 2:
|
||||
# Handle tuple results like (probability, result_string)
|
||||
prob, result_str = result
|
||||
if prob is not None and result_str is not None:
|
||||
print(f"[Stage {self.stage_id}] Valid result: prob={prob}, result={result_str}")
|
||||
inference_result = result
|
||||
break
|
||||
else:
|
||||
print(f"[Stage {self.stage_id}] Invalid tuple result: prob={prob}, result={result_str}")
|
||||
elif isinstance(result, dict):
|
||||
if result: # Non-empty dict
|
||||
print(f"[Stage {self.stage_id}] Valid dict result: {result}")
|
||||
inference_result = result
|
||||
break
|
||||
else:
|
||||
print(f"[Stage {self.stage_id}] Empty dict result")
|
||||
else:
|
||||
# For tuple results like (probability, result_string)
|
||||
print(f"[Stage {self.stage_id}] Other result type: {type(result)}")
|
||||
inference_result = result
|
||||
break
|
||||
else:
|
||||
print(f"[Stage {self.stage_id}] No result yet, waiting...")
|
||||
time.sleep(0.01)
|
||||
|
||||
# Check if inference_result is empty (handle both dict and tuple types)
|
||||
if inference_result is None or (isinstance(inference_result, dict) and not inference_result):
|
||||
print(f"[Stage {self.stage_id}] Warning: No inference result received")
|
||||
if (inference_result is None or
|
||||
(isinstance(inference_result, dict) and not inference_result) or
|
||||
(isinstance(inference_result, tuple) and (not inference_result or inference_result == (None, None)))):
|
||||
print(f"[Stage {self.stage_id}] Warning: No inference result received after 5 second timeout")
|
||||
inference_result = {'probability': 0.0, 'result': 'No Result'}
|
||||
else:
|
||||
print(f"[Stage {self.stage_id}] ✅ Successfully received inference result: {inference_result}")
|
||||
|
||||
# Step 3: Output postprocessing (inter-stage)
|
||||
processed_result = inference_result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user