封面

albumentations.augmentations.bbox_utils模块不存在报错

今天在跑easy_detection项目时出现找不到模块的报错,依赖条件也是满足的

我的环境

  • Windows 11专业版 22H2 22621.1848
  • Python 3.10.9
  • albumentations 1.3.0
  • opencv-python 4.7.0.72
  • torch 2.0.1+cu117

报错

‘stty’ �����ڲ����ⲿ���Ҳ���ǿ����еij���
�����������
Traceback (most recent call last):
File “C:\Users\Administrator\Downloads\easy_detection-master\preview.py”, line 11, in
from dataloader.dataloaders import train_dataloader, val_dataloader
File “C:\Users\Administrator\Downloads\easy_detection-master\dataloader\dataloaders.py”, line 3, in
from dataloader.list_dataset import get_all_datasets
File “C:\Users\Administrator\Downloads\easy_detection-master\dataloader\list_dataset.py”, line 3, in
from configs.transforms import get_transform
File “C:\Users\Administrator\Downloads\easy_detection-master\configs\transforms_init_.py”, line 1, in
from .no_transform import No_Transform
File “C:\Users\Administrator\Downloads\easy_detection-master\configs\transforms\no_transform.py”, line 2, in
from configs.transforms import custom_transform as C
File “C:\Users\Administrator\Downloads\easy_detection-master\configs\transforms\custom_transform.py”, line 20, in
from albumentations.augmentations.bbox_utils import denormalize_bbox, normalize_bbox, union_of_bboxes
ModuleNotFoundError: No module named ‘albumentations.augmentations.bbox_utils’

20230710051929

解决方法

  1. 找到代码中出现该代码的位置:

    1
    from albumentations.augmentations.bbox_utils import denormalize_bbox, normalize_bbox, union_of_bboxes
  2. 通过everything找到bbox_utils
    20230710053835

  3. 做出相应修改:

    1
    from albumentations.core.bbox_utils import denormalize_bbox, normalize_bbox, union_of_bboxes

成功运行

20230710054450