question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

πŸ› Bug

albumentations 1.2.1 Python 3.8.10 Ubuntu 20.04.3 LTS

Π­Ρ‚Π° ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ Π°ΡƒΠ³ΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΉ ΠΈΠ½ΠΎΠ³Π΄Π° Π²Ρ‹Π΄Π°Π²Π°Π»Π° ΠΎΡˆΠΈΠ±ΠΊΡƒ, Ρ‡Ρ‚ΠΎ Π² RandomCrop() ΠΏΡ€ΠΈΡˆΠ»Π° ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° ΠΈΠ»ΠΈ маска Ρ€Π°Π·ΠΌΠ΅Ρ€Π° 319Ρ…320, хотя оТидаСтся Π½Π΅ ΠΌΠ΅Π½Π΅Π΅ 320Ρ…320. Π’ΠΈΠ΄ΠΈΠΌΠΎ PadIfNeeded() ΠΈΠ½ΠΎΠ³Π΄Π° ΠΎΡˆΠΈΠ±Π°Π΅Ρ‚ΡΡ Π½Π° Π΅Π΄ΠΈΠ½ΠΈΡ‡ΠΊΡƒ с Ρ€Π°Π·ΠΌΠ΅Ρ€ΠΎΠΌ.

Compose([
...
        PadIfNeeded(min_height=320, min_width=320, position="random", border_mode=cv2.BORDER_CONSTANT, value=(0,0,0), p=1.0),
        RandomCrop(320, 320, always_apply=True, p=1.0),
...
        HorizontalFlip(p=0.5),
        RandomRotate90(p=1.0),

        Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
        ToTensorV2(transpose_mask=True),
    ], p=p)

Ошибка:

  File "/home/xxx/yyy/train_segmentation.py", line 867, in __next__
    augmented = self.augmentation(**data)
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/core/composition.py", line 205, in __call__
    data = t(force_apply=force_apply, **data)
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/core/transforms_interface.py", line 98, in __call__
    return self.apply_with_params(params, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/core/transforms_interface.py", line 111, in apply_with_params
    res[key] = target_function(arg, **dict(params, **target_dependencies))
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/core/transforms_interface.py", line 240, in apply_to_mask
    return self.apply(img, **{k: cv2.INTER_NEAREST if k == "interpolation" else v for k, v in params.items()})
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/augmentations/crops/transforms.py", line 48, in apply
    return F.random_crop(img, self.height, self.width, h_start, w_start)
  File "/home/xxx/.local/lib/python3.8/site-packages/albumentations/augmentations/crops/functional.py", line 46, in random_crop
    raise ValueError(
ValueError: Requested crop size (320, 320) is larger than the image size (319, 320)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Dipetcommented, Sep 25, 2022

ΠŸΠΎΠΏΡ€ΠΎΠ±ΡƒΠΉ ΠΏΠΎΡΡ‚Π°Π²ΠΈΡ‚ΡŒ try except ΠΈ ΠΏΡ€ΠΈ ошибкС вывСсти ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ маски ΠΈ изобраТСния. Π‘ΠΊΠΎΡ€Π΅Π΅ всСго Ρƒ тСбя маска ΠΈ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ΠΏΠΎ шСйпам Π½Π° 1 пиксСл ΠΎΡ‚Π»ΠΈΡ‡Π°ΡŽΡ‚ΡΡ Π²ΠΎ врСмя ошибки

вс, 25 сСнт. 2022 Π³., 21:44 Michael Monashev @.***>:

Π’Π°ΠΊ ΠΈ Ρƒ мСня воспроизводится Ρ€Π΅Π΄ΠΊΠΎ. Π”ΠΎΠ»Π³ΠΎ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚, Π° ΠΏΠΎΡ‚ΠΎΠΌ ΠΎΡˆΠΈΠ±ΠΊΡƒ Π²Ρ‹Π΄Π°Ρ‘Ρ‚. И Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΠΎΠ½ΠΎ ΠΏΠ°Π΄Π°Π΅Ρ‚ Π½Π΅ Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ, Π° Π½Π° ΠΏΠ°Ρ€Π΅: ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ°+маска.

β€” Reply to this email directly, view it on GitHub https://github.com/albumentations-team/albumentations/issues/1295#issuecomment-1257221035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKBOWNDROLMLOUYJ6D223WABXPTANCNFSM6AAAAAAQTFSG7Y . You are receiving this because you commented.Message ID: @.***>

0reactions
MichaelMonashevcommented, Sep 25, 2022

Ошибка ΠΊΠΎΠ½Π΅Ρ‡Π½ΠΎ пакостная. Π― ΡΠ»Ρ‹ΡˆΠ°Π», Ρ‡Ρ‚ΠΎ опСрация округлСния ΠΏΡ€ΠΈ Ρ€Π°Π±ΠΎΡ‚Π΅ с float-Π°ΠΌΠΈ Π² процСссорС Π½Π΅ Π΄Π΅Ρ‚Π΅Ρ€ΠΌΠΈΠ½ΠΈΡ€ΠΎΠ²Π°Π½Π° ΠΈ ΠΌΠΎΠΆΠ΅Ρ‚ Π½Π° ΠΎΠ΄ΠΈΠ½ ΠΈ Ρ‚ΠΎΡ‚ ΠΆΠ΅ ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½ΠΎ ΠΏΠΎΠ΄ΠΎΠ±Ρ€Π°Π½Π½Ρ‹ΠΉ Π°Ρ€Π³ΡƒΠΌΠ΅Π½Ρ‚ Π²Ρ‹Π΄Π°Π²Π°Ρ‚ΡŒ Ρ€Π°Π·Π½Ρ‹Π΅ Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Ρ‹ Π² зависимости ΠΎΡ‚ Ρ‚Π°ΠΊΡ‚Π° процСссора. Π—Π΄Π΅ΡΡŒ Π²ΠΈΠ΄ΠΈΠΌΠΎ Ρ‚Π°ΠΊ ΠΈ Π±Ρ‹Π»ΠΎ.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PadifNeeded does not correctly transform boxes #909 - GitHub
Bug To Reproduce import numpy as np import albumentations as A import ... A.PadIfNeeded(min_height=1000, min_width=1000, border_mode=cv2.
Read more >
Full API Reference - Albumentations Documentation
If you try to apply a spatial-level transform to an unsupported target, Albumentations will raise an error. Transform, Image, Masks, BBoxes, Keypoints. AffineΒ ......
Read more >
How to Get Rid of Wood Boring Beetles | Wood Bug Treatment
The white finish can be sanded down with a scrubbing pad if needed. Bora-Care is your best option for treatment because it will...
Read more >
albumentations Documentation - Read the Docs
If you find a bug or have a feature request file an issue at ... Compose, PadIfNeeded, CenterCrop, RandomCrop, Crop, Normalize, ToFloat,Β ...
Read more >
Advanced Tutorial 11: Model Calibration | Fastestimator
Calculating Calibration Error; Generating and Applying a Model Calibrator ... from fastestimator.op.numpyop.multivariate import HorizontalFlip, PadIfNeeded,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found