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

Cannot run demo/FLIR/demo_train_FLIR.py or any other demo scripts for training/eval (detectron2 installation issue) #26

Closed
hoomantavasso opened this issue Mar 13, 2024 · 1 comment

Comments

@hoomantavasso
Copy link

❓ How to use this repo to reproduce the results (demo/train)

1.I have used the installation here but I'm running into
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[1], line 2
1 # import some common detectron2 utilities
----> 2 from detectron2.engine import DefaultPredictor, DefaultTrainer
3 from detectron2.config import get_cfg
4 from detectron2.data import DatasetCatalog, MetadataCatalog

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/engine/init.py:11
6 all = [k for k in globals().keys() if not k.startswith("_")]
9 # prefer to let hooks and defaults live in separate namespaces (therefore not in all)
10 # but still make them available here
---> 11 from .hooks import *
12 from .defaults import *

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/engine/hooks.py:18
15 from fvcore.nn.precise_bn import get_bn_modules, update_bn_stats
17 import detectron2.utils.comm as comm
---> 18 from detectron2.evaluation.testing import flatten_results_dict
19 from detectron2.utils.events import EventStorage, EventWriter
21 from .train_loop import HookBase

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/evaluation/init.py:2
1 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
----> 2 from .cityscapes_evaluation import CityscapesEvaluator
3 from .coco_evaluation import COCOEvaluator
4 from .FLIR_evaluation import FLIREvaluator

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/evaluation/cityscapes_evaluation.py:10
7 import torch
8 from PIL import Image
---> 10 from detectron2.data import MetadataCatalog
11 from detectron2.utils import comm
13 from .evaluator import DatasetEvaluator

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/data/init.py:2
1 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
----> 2 from . import transforms # isort:skip
4 from .build import (
5 build_detection_test_loader,
6 build_detection_train_loader,
(...)
9 print_instances_class_histogram,
10 )
11 from .catalog import DatasetCatalog, MetadataCatalog

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/data/transforms/init.py:2
1 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
----> 2 from .transform import *
3 from fvcore.transforms.transform import *
4 from .transform_gen import *

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/data/transforms/transform.py:14
9 import pdb
11 all = ["ExtentTransform", "ResizeTransform"]
---> 14 class ExtentTransform(Transform):
15 """
16 Extracts a subregion from the source image and scales it to the output size.
17
(...)
21 See: https://pillow.readthedocs.io/en/latest/PIL.html#PIL.ImageTransform.ExtentTransform
22 """
24 def init(self, src_rect, output_size, interp=Image.LINEAR, fill=0):

File ~/orsted_ai/Multimodal-Object-Detection-via-Probabilistic-Ensembling/detectron2/data/transforms/transform.py:24, in ExtentTransform()
14 class ExtentTransform(Transform):
15 """
16 Extracts a subregion from the source image and scales it to the output size.
17
(...)
21 See: https://pillow.readthedocs.io/en/latest/PIL.html#PIL.ImageTransform.ExtentTransform
22 """
---> 24 def init(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
25 """
26 Args:
27 src_rect (x0, y0, x1, y1): src coordinates
(...)
30 fill: Fill color used when src_rect extends outside image
31 """
32 super().init()

AttributeError: module 'PIL.Image' has no attribute 'LINEAR'`

Is there any updated installation instructions?

Thanks!
HT

@Jamie725
Copy link
Owner

It seems like a package version issue. Please check here: facebookresearch/detectron2#5010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants