Try to change the type of scheduler. There are many available in Pytorch.
scheduler
Otherwise try to change the number of classes nc=7 directly in the configuration file defined at DEFAULT_CFG_PATH.
nc=7
DEFAULT_CFG_PATH