czimaginginstitute / 2024_czii_mlchallenge_notebooks

The repository hosting example notebooks for 2024 CZII cryoET machine learning challenge
MIT License
12 stars 2 forks source link

AttributeError: type object ‘AnnotationFile’ has no attribute ‘annotation_shape’ #7

Closed yxyyxy93 closed 1 week ago

yxyyxy93 commented 1 week ago

Hi teams,

I tried folking 2024_czii_mlchallenge_notebooks /overview.ipynb. I encountered an AttributeError perhaps when using the copick library. The error message indicates that the AnnotationFile class does not have an attribute named annotation_shape. Error Traceback: ---> 11 pick_set = example_run.get_picks(object_name=object_name)[0] File /opt/conda/lib/python3.10/site-packages/copick/impl/cryoet_data_portal.py:619, in CopickRunCDP._query_static_picks(self) 614 client = cdp.Client() 615 go_map = self.root.go_map 616 point_annos = cdp.AnnotationFile.find( 617 client, 618 [ --> 619 cdp.AnnotationFile.annotation_shape.annotation.run_id == self.portal_run_id, 620 cdp.AnnotationFile.annotation_shape.shape_type._in(["Point", "OrientedPoint"]), # noqa 621 cdp.AnnotationFile.annotation_shape.annotation.object_id._in(go_map.keys()), # noqa 622 ], 623 ) 625 return [ 626 CopickPicksCDP( 627 run=self, (...) 631 for af in point_annos 632 ]

AttributeError: type object 'AnnotationFile' has no attribute 'annotation_shape'

uermel commented 1 week ago

Hi @yxyyxy93, thanks for bringing this to our attention!

Could you tell me the output of

import cryoet_data_portal
print(cryoet_data_portal.__version__)

in the environment you're running this in? Could you also check the version of copick?

We recently released cryoet-data-portal 4.0.0. The error you're describing sounds like you may have installed an older version of the API client.

uermel commented 1 week ago

Hi @yxyyxy93, if you set up your environment using the overview.ipynb notebook or by following the instructions in tomotwin_notebook_inference.ipynb, this issue should be fixed by installing cryoet-data-portal>=4.0.0 and copick>=0.6.0. You can also compare the fix in #8.

uermel commented 1 week ago

@yxyyxy93 Closing this as a fix has been merged. If the fix does not solve your issue, please feel free to re-open.