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.7k stars 655 forks source link

[Task]: Testing error #1020

Closed sagarsirbi05 closed 1 year ago

sagarsirbi05 commented 1 year ago

What is the motivation for this task?

I am new to anomalib library and am currently training and testing the padim model on MVTec AD dataset and have encountered error in the following:

I have trained my model on MVTec AD bottle dataset and when I try to fit my model, I encoured the following error command: trainer.fit(model=model, datamodule=datamodule)

error: `--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /tmp/ipykernel_3376819/1994785069.py in 10 val_check_interval=1.0, 11 ) ---> 12 trainer.fit(model=model, datamodule=datamodule) 13 # trainer.fit(model=model, datamodule=datamodule, 14 # ckpt_path='/workspaces/research_anomaly_detection/anomalib/notebooks/mdl_ckp.ckpt')

/opt/conda/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py in fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path) 606 model = self._maybe_unwrap_optimized(model) 607 self.strategy._lightning_module = model --> 608 call._call_and_handle_interrupt( 609 self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path 610 )

/opt/conda/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py in _call_and_handle_interrupt(trainer, trainer_fn, *args, kwargs) 36 return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, *kwargs) 37 else: ---> 38 return trainer_fn(args, kwargs) 39 40 except _TunerExitException:

/opt/conda/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py in _fit_impl(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path) 648 model_connected=self.lightning_module is not None, ... -> 1704 raise child_exception_type(errno_num, err_msg, err_filename) 1705 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'mo' `

Describe the solution you'd like

It would be great if anyone can help me in this regard.

Additional context

No response

ajaye2 commented 1 year ago

Hello, how were you able to solve this?

samet-akcay commented 1 year ago

@ajaye2, are you having the exact same problem?

mrub1 commented 1 year ago

Hello @sagarsirbi05 , @ajaye2, @samet-akcay . I am experiencing the same error < FileNotFoundError: [Errno 2] No such file or directory: 'mo'> when running 001_getting_started.ipynb Were you able to resolve it ? Thank you so much.

LucasJohannsenShadow commented 1 year ago

Hi I got the same issue

OPaivaHeitor commented 1 year ago

Hello, I'm running into the same problem during training. Is there a solution for this?

martin0258 commented 1 year ago

@ajaye2 @samet-akcay @mrub1 @LucasJohannsenShadow @OPaivaHeitor

Sharing my findings and the solution (at least works for me) in case you still need help:

mo is actually a tool provided by OpenVINO, so you have to install it for it to be accessible.

If using pip, it could be installed with the follwoing command (ref)

pip install --no-deps openvino-dev

If you encountered another runtime error such as ModuleNotFoundError: No module named 'openvino.runtime', try

pip install openvino

Maybe the error message could be improved by first checking if mo is installed and accessible in PATH and showing instructions to guide people to install it (sounds like a pretty minor PR but a bit helpful)?