avalanche icon indicating copy to clipboard operation
avalanche copied to clipboard

ImportError: 'make_lvis_metrics'

Open alaa-shubbak opened this issue 3 years ago • 6 comments

🐛 Describe the bug A clear and concise description of what the bug is. I got this error message:

ImportError: cannot import name 'make_lvis_metrics' from 'avalanche.evaluation.metrics'

while running one of your examples mentioned in this link: https://avalanche.continualai.org/examples/training

🐜 To Reproduce A minimal working example to reproduce the issue. The code should be executable without modifications.

I am running one of those instructions in the terminal that has avalancha as the current environment:

python examples/detection.py or python examples/detection_lvis.py

I got same error after running any of them.

🐝 Expected behavior A clear and concise description of what you expected to happen.

I expected that i will get some results of object detection using lvis dataset

🐞 Screenshots If applicable, add screenshots to help explain your problem.

avalanche problem

🦋 Additional context Add any other context about the problem here like your python setup.

alaa-shubbak avatar Jul 27 '22 09:07 alaa-shubbak

Hi @alaa-shubbak !

Did you install avalanche with the detection packages, i.e. pip install avalanche-lib[detection]? Have a look at here the link below for more details: https://avalanche.continualai.org/getting-started/how-to-install

HamedHemati avatar Aug 16 '22 07:08 HamedHemati

Thank you for your answer. I did the install of all packages using this instruction:

pip install avalanche-lib[all]

but i got the following error:

ImportError: cannot import name 'LvisDataset' from 'avalanche.benchmarks.datasets'

alaa-shubbak avatar Aug 16 '22 19:08 alaa-shubbak

@alaa-shubbak It seems like lvis_dataset is not included in avalanche.benchmark.dataset imports. Can you change the following import line in the detection_levis example: from avalanche.benchmarks.datasets import LvisDataset -> from avalanche.benchmarks.datasets.lvis_dataset import LvisDataset

and check if it works?

HamedHemati avatar Aug 18 '22 10:08 HamedHemati

hello , thanks for your response.

i did the change in detection_levis as you mentioned. but unfortunatily , i still get the same first error of

 File "examples/detection.py", line 36, in <module>
    from avalanche.evaluation.metrics import (
ImportError: cannot import name 'make_lvis_metrics' from 'avalanche.evaluation.metrics' (C:\Users\alaas\anaconda3\envs\avalanche-env\lib\site-packages\avalanche\evaluation\metrics\__init__.py)

any another suggestion

alaa-shubbak avatar Aug 19 '22 01:08 alaa-shubbak

@alaa-shubbak This is a different error related to metric imports which we need to fix. If you want to run the code you can remove make_lvis_metrics from from avalanche.evaluation.metrics import (...) and add a new import line as below: from avalanche.evaluation.metrics.detection import make_lvis_metrics I tested it and it works.

@lrzpellegrini make_lvis_metrics which is supposed to return the metric class for Lvis is missing in detection_evaluators. Is the one implemented in avalanche.evaluation.metrics.detection.py the initializer that should be used inside the code example?

HamedHemati avatar Aug 19 '22 08:08 HamedHemati

Thank you very much , It is working.

I have two different dataset with different classes (categories). and i would like to use such structure to develop a model for my dataset. so i can teach my model (deep neural network ) on both classes to have a model that being able to detect all classes within a third small dataset. I would like to ask if i can have a guide book , repository or pdf or any source that can help me in achieve such goals.

any suggestion , or idea to start with will be highly appreciated.

thanks again.

alaa-shubbak avatar Aug 21 '22 18:08 alaa-shubbak