Issues Fine Tuning RT-DETR

I’m trying to fine tune RT-DETR on a custom dataset using the example notebook, but I’m getting the following error. 'MeanAveragePrecision' object has no attribute '_iou_type' when I scroll up in the exception chain I see this is triggered by a different exception from the following code area. if not _TORCHVISION_AVAILABLE: raise ModuleNotFoundError( f"Metric `{self._iou_type.upper()}` requires that `torchvision` is installed." " Please install with `pip install torchmetrics[detection]`." )
I have installed both torchvision and torchmetrics detecion though. This is my results from pip show

Name: pycocotools

Version: 2.0.8

Summary: Official APIs for the MS-COCO dataset

Home-page: https://github.com/ppwwyyxx/cocoapi

Author:

Author-email:

License: FreeBSD

Location:

C:\Users\-----------\anaconda3\envs\fastai\Lib\site-packages

Requires: matplotlib, numpy

Required-by:

Name: faster-coco-eval

Version: 1.6.5

Summary: Faster interpretation of the original COCOEval

Home-page: https://github.com/MiXaiLL76/faster coco eval

Author: MiXaiLL76

Author-email: mike.milos@yandex.ru

License:

Location: C:\Users\-----------\anaconda3\envs\fastai\Lib\site-packages

Requires: numpy, pandas, Pillow, plotly

Required-by:

WARNING: Package(s) not found: torchmetrics [detection]

Name: torchmetrics

Version: 1.6.1

Summary: PyTorch native Metrics

Home-page: https://github.com/Lightning-AI/torchmetrics

Author: Lightning-AI et al.

Author-email: name@pytorchlightning.ai

License: Apache-2.0

Location: C:\Users\-----------\anaconda3\envs\fastai\Lib\site-packages

Requires: lightning-utilities, numpy, packaging, torch

Required-by:

Name: torchvision

Version: 0.20.1

Summary: image and video datasets and models for torch deep learning

Home-page: https://github.com/pytorch/vision

Author: PyTorch Core Team

Author-email: soumith@pytorch.org

License: BSD

Location: C:\Users\-----------\anaconda3\envs\fastai\Lib\site-packages

Requires: numpy, pillow, torch

Required-by:

Does anyone have any advice on how to resolve this? I am also running python 3.12

1 Like

For anyone who finds this I couldn’t figure out the source of the environment issue. I switched to python 3.11 though and created a new environment. I tried installing everything again and then everything ran correctly.

2 Likes