使用官方ultralytics的代码复现RTDETR的时候报错:NotImplementedError: WARNING ⚠️ 'YOLO' model does not support '_new' mode for 'None' task yet.
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/9604713d1a3a45c382007cbe3664c17a.png)
将训练文件修改为:
import warnings
warnings.filterwarnings('ignore')
from ultralytics import RTDETR
if __name__ == '__main__':
model = RTDETR('/home/root1/miniconda3/envs/itoshi16/lib/python3.8/site-packages/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml')
model.train(data='/home/root1/data/miya/yolov8/data/data.yaml',
cache=False,
imgsz=1024,
epochs=500,
batch=4,
close_mosaic=10,
workers=8,
device='0',
optimizer='SGD',
amp=False,
project='runs/train',
name='rt',
)
此时便可以直接开始训练了:
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/d0853eb7da9344b2a2744b2f34464737.png)