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

[Bug]: EOFError: Compressed file ended before the end-of-stream marker was reached #1864

Closed jamal-saeedi closed 7 months ago

jamal-saeedi commented 8 months ago

Describe the bug

start training

engine = Engine(task=TaskType.SEGMENTATION) engine.fit(model=model, datamodule=datamodule)


EOFError Traceback (most recent call last) Cell In[6], line 3 1 # start training 2 engine = Engine(task=TaskType.SEGMENTATION) ----> 3 engine.fit(model=model, datamodule=datamodule)

File /mnt/d/projects/computer vision/anomaly detection/anomalib/anomalib-1.0.0/src/anomalib/engine/engine.py:515, in Engine.fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path) 513 self.trainer.validate(model, val_dataloaders, datamodule=datamodule, ckpt_path=ckpt_path) 514 else: --> 515 self.trainer.fit(model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)

File ~/anaconda3/envs/torch-gpu/lib/python3.11/site-packages/lightning/pytorch/trainer/trainer.py:545, in Trainer.fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path) 543 self.state.status = TrainerStatus.RUNNING 544 self.training = True --> 545 call._call_and_handle_interrupt( 546 self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path 547 )

File ~/anaconda3/envs/torch-gpu/lib/python3.11/site-packages/lightning/pytorch/trainer/call.py:44, in _call_and_handle_interrupt(trainer, trainer_fn, *args, kwargs) 42 if trainer.strategy.launcher is not None: 43 return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, *kwargs) ---> 44 return trainer_fn(args, kwargs) 46 except _TunerExitException: 47 _call_teardown_hook(trainer) ... 100 "end-of-stream marker was reached") 101 else: 102 rawblock = b""

EOFError: Compressed file ended before the end-of-stream marker was reached

Dataset

MVTec

Model

PADiM

Steps to reproduce the behavior

I have the first notebook and I got this error

OS information

OS information:

Expected behavior

?

Screenshots

image

Pip/GitHub

pip

What version/branch did you use?

1.0.0

Configuration YAML

class_path: anomalib.data.MVTec
init_args:
  root: /mnt/d/projects/dataset/MVTec/
  category: bottle
  image_size: [256, 256]
  center_crop: null
  normalization: imagenet
  train_batch_size: 8
  eval_batch_size: 8
  num_workers: 8
  task: segmentation
  transform_config_train: null
  transform_config_eval: null
  test_split_mode: from_dir
  test_split_ratio: 0.2
  val_split_mode: same_as_test
  val_split_ratio: 0.5
  seed: null

Logs

---------------------------------------------------------------------------
EOFError                                  Traceback (most recent call last)
Cell In[6], line 3
      1 # start training
      2 engine = Engine(task=TaskType.SEGMENTATION)
----> 3 engine.fit(model=model, datamodule=datamodule)

File /mnt/d/projects/computer vision/anomaly detection/anomalib/anomalib-1.0.0/src/anomalib/engine/engine.py:515, in Engine.fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    513     self.trainer.validate(model, val_dataloaders, datamodule=datamodule, ckpt_path=ckpt_path)
    514 else:
--> 515     self.trainer.fit(model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)

File ~/anaconda3/envs/torch-gpu/lib/python3.11/site-packages/lightning/pytorch/trainer/trainer.py:545, in Trainer.fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    543 self.state.status = TrainerStatus.RUNNING
    544 self.training = True
--> 545 call._call_and_handle_interrupt(
    546     self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path
    547 )

File ~/anaconda3/envs/torch-gpu/lib/python3.11/site-packages/lightning/pytorch/trainer/call.py:44, in _call_and_handle_interrupt(trainer, trainer_fn, *args, **kwargs)
     42     if trainer.strategy.launcher is not None:
     43         return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
---> 44     return trainer_fn(*args, **kwargs)
     46 except _TunerExitException:
     47     _call_teardown_hook(trainer)
...
    100                        "end-of-stream marker was reached")
    101 else:
    102     rawblock = b""

EOFError: Compressed file ended before the end-of-stream marker was reached

Code of Conduct

jamal-saeedi commented 7 months ago

the dataset path issue

maobaoqi commented 4 months ago

the dataset path issue

Hi, I meet this problem also, how the dataset path issue? The problem is strange, it appear when run the training again