-
Notifications
You must be signed in to change notification settings - Fork 459
Description
Hello! When I was running create_patches_fp.py and extract_features_fp.py, some of my svs files would prompt an error: openslide.lowlevel.OpenSlideError: Not a JPEG file: starts with 0xff 0x11. However, I was able to check the information of the svs files that caused the error using level_downsample = slide.level_downsamples[level].. The specific error message is as follows:
Traceback (most recent call last):
File "/media/dell/data/old/CLAM-master/extract_features_fp.py", line 122, in
output_file_path = compute_w_loader(output_path, loader = loader, model = model, verbose = 1)
File "/media/dell/data/old/CLAM-master/extract_features_fp.py", line 51, in compute_w_loader
for count, data in enumerate(tqdm(loader)):
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/tqdm/std.py", line 1181, in iter
for obj in iterable:
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 708, in next
data = self._next_data()
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1455, in _next_data
return self._process_data(data)
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1505, in _process_data
data.reraise()
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/_utils.py", line 733, in reraise
raise exception
openslide.lowlevel.OpenSlideError: Caught OpenSlideError in DataLoader worker process 6.
Original Traceback (most recent call last):
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
data = fetcher.fetch(index) # type: ignore[possibly-undefined]
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/media/dell/data/old/CLAM-master/dataset_modules/dataset_h5.py", line 88, in getitem
img = self.wsi.read_region(coord, self.patch_level, (self.patch_size, self.patch_size)).convert('RGB')
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/openslide/init.py", line 281, in read_region
region = lowlevel.read_region(
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/openslide/lowlevel.py", line 443, in read_region
_read_region(slide, buf, x, y, level, w, h)
File "/home/dell/anaconda3/envs/clam_latest/lib/python3.10/site-packages/openslide/lowlevel.py", line 289, in _check_error
raise OpenSlideError(err)
openslide.lowlevel.OpenSlideError: Not a JPEG file: starts with 0xff 0x11
I wonder the reason for this error and how to deal it. Many thanks for the explanation.