-
-
Notifications
You must be signed in to change notification settings - Fork 11
Labels
Milestone
Description
The issue is that InspectionAnnotation.to_dict() uses asdict() which is attempting to serialize a shape field that contains a Tensor. The shape field in line 29 is of type AmbiguousShape, which can contain tensors.
Looking at line 237 in , the shape is taken from label.shape[1:], which is a tensor shape. I need to convert it to a tuple before storing it in the annotation. inspection.py
Fixed. The issue was that label.shape[1:] returns a torch.Size object and label.unique() returns a tensor, both of which aren't JSON serializable. I converted them to tuples using tuple(label.shape[1:]) and tuple(label.unique().tolist()) at mipcandy/data/inspection.py:243.