I whittled down a simpler example of the original example and got a (I think) proper score function… only to realize the T.toTensor function does some strange things… and I need to rewrite this for inference… correct?  don’t I need to transform all images to a tensor or ?
so far I have this
@torch.no_grad()
def score(paths_to_images):
    # train on the GPU or on the CPU, if a GPU is not available
    device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')

    num_classes = 2

    dataset_inference = UnannotatedImageDataset(paths_to_images, transforms=get_transform_Inference())
    data_loader_inference_set = torch.utils.data.DataLoader(dataset_inference, batch_size=1, shuffle=False, num_workers=1, collate_fn=utils.collate_fn)

    linux_path_to_model = "/path_to_model.pth"
    path_to_model = linux_path_to_model
    model = get_model_instance_scoring(num_classes)

    state_dict = torch.load(path_to_model) if torch.cuda.is_available() else torch.load(path_to_model, map_location=device)
    model.load_state_dict(state_dict)
    model.to(device)

    n_threads = torch.get_num_threads()
    # FIXME remove this and make paste_masks_in_image run on the GPU
    torch.set_num_threads(1)
    cpu_device = torch.device("cpu")
    model.eval()

    images = list(img.to(device) for img in data_loader_inference_set)

    if torch.cuda.is_available():
        torch.cuda.synchronize()

    outputs = model(images)

    outputs = [{k: v.to(cpu_device) for k, v in t.items()} for t in outputs]
    res = {target["image_id"].item(): output for output in outputs}
    torch.set_num_threads(n_threads)

And the Transforms look like this… why when i use ToTensorInference am I getting this error ?
TypeError: __call__() missing 1 required positional argument: 'target'
class ToTensor(nn.Module):
    def forward(self, image: Tensor, target: Optional[Dict[str, Tensor]] = None) -> Tuple[Tensor, Optional[Dict[str, Tensor]]]:
        image = F.to_tensor(image)
        return image, target


class ToTensorInference(nn.Module):
    def forward(self, image: Tensor) -> Tuple[Tensor]:
        image = F.to_tensor(image)
        return image

I thought I was on the right track but… something is crashing in the scoring…
/anaconda3/envs/pytorch_base/bin/python /torchvision-objectdetection-coco/score.py
UnannotatedDataSet found 6 items of interest
/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/cuda/__init__.py:104: UserWarning: 
NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Traceback (most recent call last):
  File "/torchvision-objectdetection-coco/score.py", line 75, in <module>
    score("/test_inference_set")
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/torchvision-objectdetection-coco/score.py", line 62, in score
    images = list(img.to(device) for img in data_loader_inference_set)
  File "/torchvision-objectdetection-coco/score.py", line 62, in <genexpr>
    images = list(img.to(device) for img in data_loader_inference_set)
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
    return self._process_data(data)
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
    data.reraise()
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/_utils.py", line 429, in reraise
    raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
    data = fetcher.fetch(index)
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/anaconda3/envs/pytorch_base/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/emcp/Dev/git/EMCP/pytorch-tutorials/intermediate/torchvision-objectdetection-coco/datasets/UnannotatedImageDataset.py", line 49, in __getitem__
    img = self.transforms(img)
TypeError: __call__() missing 1 required positional argument: 'target'


Process finished with exit code 1