ModuleNotFoundError: No module named 'anomalib.engine'

610 Views Asked by At
# Import the required modules

from anomalib.data import MVTec
from anomalib.models import Patchcore
from anomalib.engine import Engine

error:

ModuleNotFoundError: No module named 'anomalib.engine'

I'm trying to run this.... have followed the library installation and seen the https://anomalib.readthedocs.io/en/latest/markdown/get_started/anomalib.html I think its either becuase the engine has been modified or it has been dropped by the library...

How to resolve this?

1

There are 1 best solutions below

0
Shun Shimizu On

I had a same problem. That document is probably for ver 1.0.0, but currently pip installs ver 0.7.0 instead of 1.0.0.

So I tried a following installation code and ModuleNotFoundError disappear in my Google Colab environment.

!git clone https://github.com/openvinotoolkit/anomalib.git
%cd anomalib
%pip install .

FYI However, even after passing this error, the error No module named 'openvino.tools.mo' occurred in openvino installed with pip.

It could be fixed by installing openvino-dev as listed in the GitHub repo.

%pip install openvino-dev==2023.0