Hi i am creating an object detector, for that I am using the following code for creating the custom dataset:
class MIMICCXRDataset(Dataset):
def __init__(self,
             split,
             args,
             radgraph_sids,
             radgraph_adj_mtx,
             mode,
             transform=None):

    self.args = args
    self.mode = mode
    self.transform = transform
 ..........

def __getitem__(self, idx):
    # 1. get the sample key, i.e., DICOM ID
    dicom_id = self.dicom_ids[idx]
    study_id = list(self.df_master_sel.loc[self.df_master_sel['dicom_id'] == dicom_id, 'study_id'])[0]
    idx_sid = list(self.arr_radgraph_sids).index(str(study_id))

    # 2. select and load image
    img_pth_old = self.df_master_sel.iloc[idx, 4]
    img_pth_components = img_pth_old.split("/")
    img_pth = os.path.join(
        self.args.image_path_ocean_shared,
        *img_pth_components[11:]
    )

    image = Image.open(img_pth).convert('RGB')
    np_res_bbox = np.array(res_bbox)

    if len(np_res_bbox.shape) == 1:
        np_res_bbox = np.reshape(np_res_bbox, (1, -1))

    for i in range(np_res_bbox.shape[0]):
        x1 = np_res_bbox[i, 0]
        y1 = np_res_bbox[i, 1]
        x2 = np_res_bbox[i, 2]
        y2 = np_res_bbox[i, 3]
        boxes.append([x1, y1, x2, y2])

    boxes = torch.as_tensor(boxes, dtype=torch.float32)
    if disease == "pneumonia":
        labels = torch.ones((boxes.size(0),), dtype=torch.int64)
    elif disease == "pneumothorax":
        labels = torch.ones((boxes.size(0),), dtype=torch.int64)

    area = (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 2] - boxes[:, 0])
    iscrowd = torch.zeros((boxes.size(0),), dtype=torch.int64)
    target = {}
    target["boxes"] = boxes
    target["labels"] = labels
    target["image_id"] = torch.tensor(idx)
    target["area"] = area
    target["iscrowd"] = iscrowd

    if self.transform is not None:
        image, target = self.transform(image, target)

I am getting the error in the transforms. My transforms are as follows:
train_dataset = MIMICCXRDataset(
split=split,
args=args,
radgraph_sids=arr_radgraph_sids,
radgraph_adj_mtx=arr_radgraph_adj,
mode=‘bbox’,
transform=transforms.Compose([
transforms.Resize(args.resize),
# resize smaller edge to args.resize and the
# aspect ratio the same for the longer edge
transforms.CenterCrop(args.resize),
transforms.ToTensor(),  # convert pixel value to [0, 1]
normalize
])
)