Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: "Unable to synchronously open attribute (can't locate attribute: 'patch_level')" #246

Open
MarioPaps opened this issue May 1, 2024 · 0 comments

Comments

@MarioPaps
Copy link

Hi,

I ran the patch creator script to generate h5 files. I then ran the 'create_features_fp.py' script to obtain feature vectors.
However, I get the following error:
Traceback (most recent call last):
File "/rds/general/user/kp4718/home/RCS_help/CLAM/extract_features_fp.py", line 100, in
dataset = Whole_Slide_Bag_FP(file_path=h5_file_path,
File "/rds/general/user/kp4718/home/RCS_help/CLAM/dataset_modules/dataset_h5.py", line 65, in init
self.patch_level = f['coords'].attrs['patch_level']
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/rds/general/user/kp4718/home/anaconda3/envs/clam_latest/lib/python3.10/site-packages/h5py/_hl/attrs.py", line 56, in getitem
attr = h5a.open(self._id, self._e(name))
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5a.pyx", line 80, in h5py.h5a.open
KeyError: "Unable to synchronously open attribute (can't locate attribute: 'patch_level')"

I checked the h5 files and I found that they do not have the attribute patch_level.

What options should I give to create_patches.py to avoid this error?
I ran it as follows: python create_patches.py --source surformerpat --save_dir surformertiles --patch_size 256 --patch_level 2 --seg --patch --stitch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant