🐞 HTTP 404 #3246
-
Describe the bug404 http error when downloading MVTecAD dataset. DatasetMVTecAD ModelN/A Steps to reproduce the behaviorInstall anomalib using pip install anomalib. OS informationOS information:
Expected behaviordownload the dataset and work ScreenshotsNo response Pip/GitHubpip What version/branch did you use?not sure, the one that is default Configuration YAMLI don't know where to config it.Logs────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198 │
│ in _run_code:88 │
│ │
│ in <module>:7 │
│ │
│ 4 from anomalib.cli.cli import main │
│ 5 if __name__ == '__main__': │
│ 6 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │
│ ❱ 7 │ sys.exit(main()) │
│ 8 │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\cli\cli.py:492 │
│ in main │
│ │
│ 489 def main() -> None: │
│ 490 │ """Trainer via Anomalib CLI.""" │
│ 491 │ configure_logger() │
│ ❱ 492 │ AnomalibCLI() │
│ 493 │
│ 494 │
│ 495 if __name__ == "__main__": │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\cli\cli.py:83 │
│ in __init__ │
│ │
│ 80 │ │ │ self.before_instantiate_classes() │
│ 81 │ │ │ self.instantiate_classes() │
│ 82 │ │ if run: │
│ ❱ 83 │ │ │ self._run_subcommand() │
│ 84 │ │
│ 85 │ @staticmethod │
│ 86 │ def init_parser(**kwargs) -> ArgumentParser: │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\cli\cli.py:370 │
│ in _run_subcommand │
│ │
│ 367 │ │ elif self.config["subcommand"] in {*self.subcommands(), "train", "export", "pred │
│ 368 │ │ │ fn = getattr(self.engine, self.subcommand) │
│ 369 │ │ │ fn_kwargs = self._prepare_subcommand_kwargs(self.subcommand) │
│ ❱ 370 │ │ │ fn(**fn_kwargs) │
│ 371 │ │ elif PIPELINE_REGISTRY is not None and self.subcommand in pipeline_subcommands() │
│ 372 │ │ │ run_pipeline(self.config) │
│ 373 │ │ else: │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\engine\engine.p │
│ y:719 in train │
│ │
│ 716 │ │ │ # if the model is zero-shot or few-shot, we only need to run validate for no │
│ 717 │ │ │ self.trainer.validate(model, val_dataloaders, None, verbose=False, datamodul │
│ 718 │ │ else: │
│ ❱ 719 │ │ │ self.trainer.fit(model, train_dataloaders, val_dataloaders, datamodule, ckpt │
│ 720 │ │ return self.trainer.test(model, test_dataloaders, ckpt_path=ckpt_path, datamodul │
│ 721 │ │
│ 722 │ def export( │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\trainer.py:584 in fit │
│ │
│ 581 │ │ self.state.status = TrainerStatus.RUNNING │
│ 582 │ │ self.training = True │
│ 583 │ │ self.should_stop = False │
│ ❱ 584 │ │ call._call_and_handle_interrupt( │
│ 585 │ │ │ self, │
│ 586 │ │ │ self._fit_impl, │
│ 587 │ │ │ model, │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\call.py:49 in _call_and_handle_interrupt │
│ │
│ 46 │ try: │
│ 47 │ │ if trainer.strategy.launcher is not None: │
│ 48 │ │ │ return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, │
│ ❱ 49 │ │ return trainer_fn(*args, **kwargs) │
│ 50 │ │
│ 51 │ except _TunerExitException: │
│ 52 │ │ _call_teardown_hook(trainer) │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\trainer.py:630 in _fit_impl │
│ │
│ 627 │ │ │ model_provided=True, │
│ 628 │ │ │ model_connected=self.lightning_module is not None, │
│ 629 │ │ ) │
│ ❱ 630 │ │ self._run(model, ckpt_path=ckpt_path, weights_only=weights_only) │
│ 631 │ │ │
│ 632 │ │ assert self.state.stopped │
│ 633 │ │ self.training = False │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\trainer.py:1037 in _run │
│ │
│ 1034 │ │ self.__setup_profiler() │
│ 1035 │ │ │
│ 1036 │ │ log.debug(f"{self.__class__.__name__}: preparing data") │
│ ❱ 1037 │ │ self._data_connector.prepare_data() │
│ 1038 │ │ │
│ 1039 │ │ call._call_setup_hook(self) # allow user to set up LightningModule in accelerat │
│ 1040 │ │ log.debug(f"{self.__class__.__name__}: configuring model") │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\connectors\data_connector.py:95 in prepare_data │
│ │
│ 92 │ │ │ prepare_data_per_node = datamodule.prepare_data_per_node │
│ 93 │ │ │ with _InfiniteBarrier(): │
│ 94 │ │ │ │ if (prepare_data_per_node and local_rank_zero) or (not prepare_data_per_ │
│ ❱ 95 │ │ │ │ │ call._call_lightning_datamodule_hook(trainer, "prepare_data") │
│ 96 │ │ │
│ 97 │ │ # handle lightning module prepare data: │
│ 98 │ │ if lightning_module is not None and is_overridden("prepare_data", lightning_modu │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning\pytorch\traine │
│ r\call.py:199 in _call_lightning_datamodule_hook │
│ │
│ 196 │ fn = getattr(trainer.datamodule, hook_name) │
│ 197 │ if callable(fn): │
│ 198 │ │ with trainer.profiler.profile(f"[LightningDataModule]{trainer.datamodule.__class │
│ ❱ 199 │ │ │ return fn(*args, **kwargs) │
│ 200 │ return None │
│ 201 │
│ 202 │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\data\datamodule │
│ s\image\mvtecad.py:219 in prepare_data │
│ │
│ 216 │ │ if (self.root / self.category).is_dir(): │
│ 217 │ │ │ logger.info("Found the dataset.") │
│ 218 │ │ else: │
│ ❱ 219 │ │ │ download_and_extract(self.root, DOWNLOAD_INFO) │
│ 220 │
│ 221 │
│ 222 @deprecate(since="2.1.0", remove="2.3.0", use="MVTecAD") │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\anomalib\data\utils\down │
│ load.py:313 in download_and_extract │
│ │
│ 310 │ │ if info.url.startswith("http://") or info.url.startswith("https://"): │
│ 311 │ │ │ with DownloadProgressBar(unit="B", unit_scale=True, miniters=1, desc=info.na │
│ 312 │ │ │ │ # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dyna │
│ ❱ 313 │ │ │ │ urlretrieve( # noqa: S310 # nosec B310 │
│ 314 │ │ │ │ │ url=f"{info.url}", │
│ 315 │ │ │ │ │ filename=downloaded_file_path, │
│ 316 │ │ │ │ │ reporthook=progress_bar.update_to, │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:241 in urlretrieve │
│ │
│ 238 │ """ │
│ 239 │ url_type, path = _splittype(url) │
│ 240 │ │
│ ❱ 241 │ with contextlib.closing(urlopen(url, data)) as fp: │
│ 242 │ │ headers = fp.info() │
│ 243 │ │ │
│ 244 │ │ # Just return the local path and the "headers" for file:// │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:216 in urlopen │
│ │
│ 213 │ │ _opener = opener = build_opener() │
│ 214 │ else: │
│ 215 │ │ opener = _opener │
│ ❱ 216 │ return opener.open(url, data, timeout) │
│ 217 │
│ 218 def install_opener(opener): │
│ 219 │ global _opener │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:525 in open │
│ │
│ 522 │ │ meth_name = protocol+"_response" │
│ 523 │ │ for processor in self.process_response.get(protocol, []): │
│ 524 │ │ │ meth = getattr(processor, meth_name) │
│ ❱ 525 │ │ │ response = meth(req, response) │
│ 526 │ │ │
│ 527 │ │ return response │
│ 528 │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:634 in http_response │
│ │
│ 631 │ │ # According to RFC 2616, "2xx" code indicates that the client's │
│ 632 │ │ # request was successfully received, understood, and accepted. │
│ 633 │ │ if not (200 <= code < 300): │
│ ❱ 634 │ │ │ response = self.parent.error( │
│ 635 │ │ │ │ 'http', request, response, code, msg, hdrs) │
│ 636 │ │ │
│ 637 │ │ return response │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:563 in error │
│ │
│ 560 │ │ │
│ 561 │ │ if http_err: │
│ 562 │ │ │ args = (dict, 'default', 'http_error_default') + orig_args │
│ ❱ 563 │ │ │ return self._call_chain(*args) │
│ 564 │
│ 565 # XXX probably also want an abstract factory that knows when it makes │
│ 566 # sense to skip a superclass in favor of a subclass and when it might │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:496 in _call_chain │
│ │
│ 493 │ │ handlers = chain.get(kind, ()) │
│ 494 │ │ for handler in handlers: │
│ 495 │ │ │ func = getattr(handler, meth_name) │
│ ❱ 496 │ │ │ result = func(*args) │
│ 497 │ │ │ if result is not None: │
│ 498 │ │ │ │ return result │
│ 499 │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py:643 in │
│ http_error_default │
│ │
│ 640 │
│ 641 class HTTPDefaultErrorHandler(BaseHandler): │
│ 642 │ def http_error_default(self, req, fp, code, msg, hdrs): │
│ ❱ 643 │ │ raise HTTPError(req.full_url, code, msg, hdrs, fp) │
│ 644 │
│ 645 class HTTPRedirectHandler(BaseHandler): │
│ 646 │ # maximum number of redirections to any single URL │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
HTTPError: HTTP Error 404: Not FoundCode of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Thanks for submitting this issue! It has been added to our triage queue. A maintainer will review it shortly. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, recently the MVTECAd dataset URL has changed. You can either : Edit : to install anomalib from main, simplest solution is to do |
Beta Was this translation helpful? Give feedback.
-
|
Hi, |
Beta Was this translation helpful? Give feedback.
Hi, recently the MVTECAd dataset URL has changed.
This was fixed in #3138 and is merged to main already. We are yet to make a release with the fix.
You can either :
a) install anomalib from the main branch
or
b) download the dataset file from https://www.mydrive.ch/shares/38536/3830184030e49fe74747669442f0f283/download/420938113-1629960298/mvtec_anomaly_detection.tar.xz
manually to the datasets directory.
Edit : to install anomalib from main, simplest solution is to do
pip install git+https://github.com/open-edge-platform/anomalib.gitor
uv pip install git+https://github.com/open-edge-platform/anomalib.gitif you are using uv