Jiangbo-Shi / ViLa-MIL

ViLa-MIL: Dual-scale Vision-Language Multiple Instance Learning for Whole Slide Image Classification (CVPR 2024)
29 stars 1 forks source link

OSError: cannot find loader for this HDF5 file #9

Open superli6 opened 1 month ago

superli6 commented 1 month ago

Why do I get this error? How can I solve it?Traceback (most recent call last): File "feature_extraction/patch_extraction.py", line 25, in <module> enc_name=model_name, dataset='BRIGHT', batch_size=args.batch_size) File "/home/hp/new/lgq/MG-Trans-main/feature_extraction/patch_extraction_utils.py", line 113, in create_embeddings save_embeddings(model, fname, dataloader, enc_name) File "/home/hp/new/lgq/MG-Trans-main/feature_extraction/patch_extraction_utils.py", line 53, in save_embeddings for batch, coord in dataloader: File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 363, in __next__ data = self._next_data() File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 989, in _next_data return self._process_data(data) File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1014, in _process_data data.reraise() File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/_utils.py", line 395, in reraise raise self.exc_type(msg) OSError: Caught OSError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop data = fetcher.fetch(index) File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/hp/new/lgq/MG-Trans-main/feature_extraction/patch_extraction_utils.py", line 134, in __getitem__ img = Image.open(fn).convert('RGB') File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/PIL/Image.py", line 873, in convert self.load() File "/home/hp/anaconda3/envs/lgq-MG/lib/python3.7/site-packages/PIL/ImageFile.py", line 323, in load raise OSError("cannot find loader for this %s file" % self.format) OSError: cannot find loader for this HDF5 file It shows that the problem is here. Did I make a mistake in the steps? This has been bothering me for a long time. 屏幕截图 2024-08-06 200634