liznerski / fcdd

Repository for the Explainable Deep One-Class Classification paper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while execution MVTEC runner

dimadobriy opened this issue · comments

Greetings!
First of all, I would like to thank you for sharing this project. It was a pleasure to study the main paper.
I would like to ask for some help in solving the problems related to running the code.
The first problem occurred after running the command
pip install .

It failed to install the required version of pprofile. By modifying the requirements.txt for pprofile from version pprofile==2.0.5 to pprofile==2.1, the problem was solved.
The Fashion MNIST and CIFAR runners seem to be working correctly. However, MVTec-AD, unfortunately, does not start. Any idea what I could be doing wrong? is it possible that this error was a consequence of changing the version of the pprofile?

Thanks for patience.

I use Ubuntu 20.04, virtualenv

LOG:

/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/torchvision/transforms/transforms.py:280: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
  warnings.warn(
Downloading ftp://guest:GU%2E205dldo@ftp.softronics.ch/mvtec_anomaly_detection/mvtec_anomaly_detection.tar.xz to /home/dima/cham/fcdd/data/datasets/mvtec/mvtec_anomaly_detection.tar.xz
0it [00:00, ?it/s]Plotting ROC for completed classes up to 0...
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1571, in ftp_open
    fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 1592, in connect_ftp
    return ftpwrapper(user, passwd, host, port, dirs, timeout,
  File "/usr/lib/python3.8/urllib/request.py", line 2413, in __init__
    self.init()
  File "/usr/lib/python3.8/urllib/request.py", line 2423, in init
    self.ftp.login(self.user, self.passwd)
  File "/usr/lib/python3.8/ftplib.py", line 410, in login
    resp = self.sendcmd('PASS ' + passwd)
  File "/usr/lib/python3.8/ftplib.py", line 277, in sendcmd
    return self.getresp()
  File "/usr/lib/python3.8/ftplib.py", line 250, in getresp
    raise error_perm(resp)
ftplib.error_perm: 530 Login incorrect.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "runners/run_mvtec.py", line 19, in <module>
    runner.run()
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/runners/bases.py", line 203, in run
    self.run_classes(**vars(self.args))
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/runners/bases.py", line 221, in run_classes
    res = self.run_seeds(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/runners/bases.py", line 181, in run_seeds
    res = self.run_one(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/runners/bases.py", line 100, in run_one
    setup = trainer_setup(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/training/setup.py", line 104, in trainer_setup
    ds = load_dataset(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/__init__.py", line 42, in load_dataset
    dataset = ADMvTec(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec.py", line 214, in __init__
    train_set = MvTec(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec_base.py", line 78, in __init__
    self.download(shape=self.shape[1:])
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec_base.py", line 148, in download
    self.download_and_extract_archive(
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec_base.py", line 266, in download_and_extract_archive
    MvTec.download_url(url, download_root, filename)
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec_base.py", line 315, in download_url
    raise e
  File "/home/dima/cham/fcdd/python/venv/lib/python3.8/site-packages/fcdd/datasets/mvtec_base.py", line 304, in download_url
    urllib.request.urlretrieve(url, fpath, reporthook=gen_bar_updater())
  File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1589, in ftp_open
    raise exc.with_traceback(sys.exc_info()[2])
  File "/usr/lib/python3.8/urllib/request.py", line 1571, in ftp_open
    fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 1592, in connect_ftp
    return ftpwrapper(user, passwd, host, port, dirs, timeout,
  File "/usr/lib/python3.8/urllib/request.py", line 2413, in __init__
    self.init()
  File "/usr/lib/python3.8/urllib/request.py", line 2423, in init
    self.ftp.login(self.user, self.passwd)
  File "/usr/lib/python3.8/ftplib.py", line 410, in login
    resp = self.sendcmd('PASS ' + passwd)
  File "/usr/lib/python3.8/ftplib.py", line 277, in sendcmd
    return self.getresp()
  File "/usr/lib/python3.8/ftplib.py", line 250, in getresp
    raise error_perm(resp)
urllib.error.URLError: <urlopen error ftp error: error_perm('530 Login incorrect.')>
0it [00:00, ?it/s]```

it seems the problem is in connection with FTP server, isn't it?

Hey. Yes, it seems that MVTec changed the download link for the dataset. I updated the link in the code and pushed it. Should work now.

PS: The pprofile package is actually optional. I removed it from requirements.txt.

@liznerski Great, it works! Thank you.