YOLOX отсутствует в реестре mmengine::model.Python

Программы на Python
Ответить
Anonymous
 YOLOX отсутствует в реестре mmengine::model.

Сообщение Anonymous »

Это мой файл конфигурации:

Код: Выделить всё

model = dict(
type='YOLOX',  # YOLOX architecture
backbone=dict(type='CSPDarknet', deepen_factor=1.0, widen_factor=1.0),  # YOLOX backbone
neck=dict(type='YOLOXPAFPN', in_channels=[256, 512, 1024], out_channels=[256, 512, 1024]),
bbox_head=dict(
type='YOLOXHead',
num_classes=1,  # Update this based on the number of classes in your dataset
in_channels=256,
feat_channels=256
),
train_cfg=dict(assigner=dict(type='SimOTAAssigner', center_radius=2.5)),
test_cfg=dict(score_thr=0.01, nms=dict(type='nms', iou_threshold=0.65))
)
В следующем коде указан YOLOX:

Код: Выделить всё

from mmdet.registry import MODELS

# Print all available models in the registry
print(MODELS.module_dict.keys())
Однако запуск этого кода:

Код: Выделить всё

from mmengine.config import Config
from mmengine.runner import Runner
from mmdet.utils import register_all_modules

# Register all modules for MMYOLO and MMDetection
register_all_modules()

def train_model(config_file):
# Load the configuration
cfg = Config.fromfile(config_file)

# Ensure the working directory for checkpoints and logs
cfg.work_dir = './checkpoints'

# Build the runner
runner = Runner.from_cfg(cfg)

# Start training
runner.train()
print("Training completed! Checkpoints saved to './checkpoints'.")

# Path to your configuration file
config_file = 'configs/yolov7/yolox_subset_coco.py'

# Train the model
train_model(config_file)
выдает следующую ошибку:

Код: Выделить всё

KeyError: 'YOLOX is not in the mmengine::model registry. Please check whether the value of `YOLOX` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'
То же самое относится и к модели YOLOv7, которую я и хотел бы использовать. Как вы думаете, в чем здесь ошибка?

Подробнее здесь: https://stackoverflow.com/questions/791 ... l-registry
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»