Skip to content

索引超出 #73

@Grizemc

Description

@Grizemc

[SAMM INFO] Time for embedding computing is saved: "D:\slicer\samm-main\samm-python-terminal\samm-workspace/timearr_EMB.pkl"
Length of dataNode.features[msg['view']]: 15
Exception in thread Thread-1 (looping):
Traceback (most recent call last):
File "D:\anaconda\envs\samm\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "D:\anaconda\envs\samm\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "D:\slicer\samm-main\samm-python-terminal\sam_server.py", line 53, in looping
retMsg, lateExec = self.callback(cmd, msg)
File "D:\slicer\samm-main\samm-python-terminal\utl_sam_server.py", line 343, in sammProcessingCallBack
msgBack, lateUpdate = callBackListcmdType
File "D:\slicer\samm-main\samm-python-terminal\utl_sam_server.py", line 280, in sammProcessingCallBack_INFERENCE
seg = helperPredict(dataNode, msg, points, point_labels, bbox2d)
File "D:\slicer\samm-main\samm-python-terminal\utl_sam_server.py", line 213, in helperPredict
print(f"Length of dataNode.features[msg['view']][msg['n']]: {len(dataNode.features[msg['view']][msg['n']])}")
IndexError: list index out of range

question:dataNode.samPredictor[msg["view"]].features = dataNode.features[msg["view"]][msg["n"]].to(dataNode.device)
if isinstance(bbox2d, (np.ndarray, np.generic)):
seg, _, _ = dataNode.samPredictor[msg["view"]].predict(
point_coords = points,
point_labels = labels,
box = bbox2d,
multimask_output = False)
else:
seg, _, _ = dataNode.samPredictor[msg["view"]].predict(
point_coords = points,
point_labels = labels,
multimask_output = False)
seg = seg[0]
return seg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions