openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.87k stars 687 forks source link

[Bug]: ModuleNotFoundError: No module named 'FrEIA' #2264

Closed sunthehope closed 3 months ago

sunthehope commented 3 months ago

Describe the bug

File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\cflow\utils.py", line 11, in from FrEIA.framework import SequenceINN ModuleNotFoundError: No module named 'FrEIA'

Dataset

Other (please specify in the text field below)

Model

Other (please specify in the field below)

Steps to reproduce the behavior

WHY

OS information

OS information:

Expected behavior

I hope train.py can run normally

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

main

Configuration YAML

about-time                4.2.1                    pypi_0    pypi
absl-py                   2.1.0                    pypi_0    pypi
accessible-pygments       0.0.5                    pypi_0    pypi
aiofiles                  23.2.1                   pypi_0    pypi
aiohappyeyeballs          2.4.0                    pypi_0    pypi
aiohttp                   3.10.5                   pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
alabaster                 0.7.16                   pypi_0    pypi
alembic                   1.13.2                   pypi_0    pypi
alive-progress            3.1.5                    pypi_0    pypi
aniso8601                 9.0.1                    pypi_0    pypi
annotated-types           0.7.0                    pypi_0    pypi
anomalib                  1.2.0.dev0               pypi_0    pypi
ansicon                   1.89.0                   pypi_0    pypi
antlr4-python3-runtime    4.9.3                    pypi_0    pypi
anyio                     4.4.0                    pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
argon2-cffi               23.1.0                   pypi_0    pypi
argon2-cffi-bindings      21.2.0                   pypi_0    pypi
arrow                     1.3.0                    pypi_0    pypi
asttokens                 2.4.1                    pypi_0    pypi
async-lru                 2.0.4                    pypi_0    pypi
async-timeout             4.0.3                    pypi_0    pypi
attrs                     24.2.0                   pypi_0    pypi
autograd                  1.6.2                    pypi_0    pypi
av                        12.3.0                   pypi_0    pypi
babel                     2.16.0                   pypi_0    pypi
beautifulsoup4            4.12.3                   pypi_0    pypi
blas                      1.0                         mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
bleach                    6.1.0                    pypi_0    pypi
blessed                   1.20.0                   pypi_0    pypi
blinker                   1.8.2                    pypi_0    pypi
boto3                     1.35.2                   pypi_0    pypi
botocore                  1.35.2                   pypi_0    pypi
brotli-python             1.1.0           py310h00ffb61_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
bzip2                     1.0.8                h2466b09_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ca-certificates           2024.7.4             h56e8100_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cachetools                5.5.0                    pypi_0    pypi
.....

Logs

(anomalib_annew) E:\anomalib_an\anomalib-main\anomalib-main>python tools/train.py
D:\Users\imhao\anaconda3\envs\anomalib_annew\lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
Traceback (most recent call last):
  File "E:\anomalib_an\anomalib-main\anomalib-main\tools\train.py", line 3, in <module>
    from anomalib.models import Patchcore
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\__init__.py", line 15, in <module>
    from .image import (
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\__init__.py", line 7, in <module>
    from .cflow import Cflow
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\cflow\__init__.py", line 6, in <module>
    from .lightning_model import Cflow
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\cflow\lightning_model.py", line 27, in <module>
    from .torch_model import CflowModel
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\cflow\torch_model.py", line 15, in <module>
    from .utils import cflow_head, get_logp, positional_encoding_2d
  File "E:\anomalib_an\anomalib-main\anomalib-main\src\anomalib\models\image\cflow\utils.py", line 11, in <module>
    from FrEIA.framework import SequenceINN
ModuleNotFoundError: No module named 'FrEIA'

Code of Conduct

ashwinvaidya17 commented 3 months ago

I think you are using an older version of anomalib. The main branch does not have tools/train.py anymore. In either case, did you try pip install freia