Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File config/yoeo-custom.cfg doesnt exist for custom datasets training. #124

Closed
boninale opened this issue Dec 3, 2024 · 1 comment · Fixed by #125
Closed

File config/yoeo-custom.cfg doesnt exist for custom datasets training. #124

boninale opened this issue Dec 3, 2024 · 1 comment · Fixed by #125
Labels
bug Something isn't working

Comments

@boninale
Copy link

boninale commented Dec 3, 2024

I have been trying to use YOEO on a custom dataset, but the config file for custom datasets you mentionned in the README doesnt exist :

"To train on the custom dataset run:
poetry run yoeo-train --model config/yoeo-custom.cfg --data config/custom.data"

Heres the environment information as printed when running the script :

Environment information:
System: Windows 10
Current Version: YOEO 1.6.0
Current Commit Hash: d0393c1
Command line arguments: Namespace(model='config/yoeo-custom.cfg', data='config/custom.data', epochs=300, verbose=False, n_cpu=8, pretrained_weights=None, checkpoint_interval=1, checkpoint_dir='checkpoints', evaluation_interval=1, multiscale_training=False, iou_thres=0.5, conf_thres=0.1, nms_thres=0.5, logdir='logs', seed=-1, class_config='class_config/default.yaml')

I also tried using --model config/yoeo.cfg but I am getting an Index Error (I do not know if it is related to the configuration I am using or not) :
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Alexandre Bonin\Documents\Stage\YOEO\yoeo\train.py", line 176, in run
loss, loss_components = compute_loss(outputs, (bb_targets, mask_targets), model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alexandre Bonin\Documents\Stage\YOEO\yoeo\utils\loss.py", line 66, in compute_loss
seg_loss = nn.CrossEntropyLoss()(seg_predictions[0], seg_targets).unsqueeze(0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alexandre Bonin\AppData\Local\pypoetry\Cache\virtualenvs\yoeo-ZupAADRy-py3.12\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alexandre Bonin\AppData\Local\pypoetry\Cache\virtualenvs\yoeo-ZupAADRy-py3.12\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alexandre Bonin\AppData\Local\pypoetry\Cache\virtualenvs\yoeo-ZupAADRy-py3.12\Lib\site-packages\torch\nn\modules\loss.py", line 1293, in forward
return F.cross_entropy(
^^^^^^^^^^^^^^^^
File "C:\Users\Alexandre Bonin\AppData\Local\pypoetry\Cache\virtualenvs\yoeo-ZupAADRy-py3.12\Lib\site-packages\torch\nn\functional.py", line 3479, in cross_entropy
return torch._C._nn.cross_entropy_loss(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: Target 4 is out of bounds.

I also haven't updated the class_config file, as it wasn't mentionned in the documentation, but was careful of following the expected data format for custom datasets.

Thank you for your help

@boninale boninale added the bug Something isn't working label Dec 3, 2024
@Flova
Copy link
Member

Flova commented Dec 3, 2024

Good catch.

The number of output channels for the yolo and segmentation layers differ if you use a different number of classes (both for object detection and semantic segmentation).

You need to adapt the cfg accordingly.

#125 adds a script for this and extends the README.md.

@Flova Flova closed this as completed in #125 Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants