Repository navigation
Description
Hi
Is U-Net supported or not? Docs (https://www.libreyolo.com/docs/models/unet) say it is supported but the library says it is not.
So I just tried to use U-Net as per the instructions
from libreyolo import LibreYOLO
model = LibreYOLO("LibreUNets-sem.pt")but this fails as the weights do not appear to be packed inside standard pip install libreyolo and I get error
model = LibreYOLO("LibreUNets-sem.pt")
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\miniconda3\libreyolo_1\Lib\site-packages\libreyolo\models\__init__.py", line 464, in LibreYOLO
raise ValueError(
ValueError: Model weights file not found: weights\LibreUNets-sem.pt
Cannot auto-download: unable to determine size from filename.
Please specify size explicitly or provide a valid weights file path.So I got the weights from Hugging Face (https://huggingface.co/LibreYOLO/LibreUNets-sem/) and tried to run the same model = LibreYOLO(r"c:\models\LibreUNets-sem.pt" but this also fails with the following error:
model = LibreYOLO(model_weights)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\miniconda3\envs\libreyolo_1\Lib\site-packages\libreyolo\models\__init__.py", line 634, in LibreYOLO
raise ValueError(
ValueError: Could not detect model architecture from state dict keys.
Registered model families: alexnet, birefnet, centernet, clip, convnext, deeplabv3, deformable_detr, deim, deimv2, deit, depth_anything, depth_anything3, detr, dexined, dfine, dinodetr, domedetr, ec, efficientdet, efficientnetv2, eomt, faster_rcnn, fcn, fcos, feynobg, fomo, hrnet, l2cs, lingbotvision, lwdetr, mask_rcnn, midas, mobilenetv4, moge2, nafnet, picodet, pidnet, ppocr, realesrgan, resnet, retinanet, rtdetr, rtdetrv2, rtdetrv4, rtmdet, segformer, siglip2, ssd, swin, swinir, teed, vgg, vit, yolo1, yolo2, yolo3, yolo4, yolo7, yolo9, yolo9_e2e, yolo9_p2, yolonas, yolox, zipdepth.I also tried importing the model directly as per docs (see code below) but the LibreUNet class is not in the package so can't be imported
from libreyolo import LibreUNet
# Random initialization: this trains from scratch.
model = LibreUNet(size="s", device="cpu")
# Replace with your semantic segmentation dataset YAML (image/mask pairs).
model.train(data="path/to/your/semantic_dataset.yaml", pretrained=False, epochs=1, device="cpu", workers=0)So U-net is not in the model families... is it supported and how? It feels docs or the library need an update if anything else.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
EHxuban11 commentedon Oct 28, 2026
Hello @moltco , I hope you are well!
This model was added in the version v1.6.0, could you check if you are in an older version?
moltco commentedon Oct 29, 2026
Thank you, that was it! I was on 1.5.0 and hadn't realised there was a dependency on 1.6.0 for u-net.