Skip to content

Add Hebart2023 Dataset - #420

Merged
mschrimpf merged 10 commits into
brain-score:masterfrom
linus-md:packaging
Jan 4, 2024
Merged

mschrimpf merged 10 commits into
brain-score:masterfrom
linus-md:packaging

Conversation

@linus-md

Copy link
Copy Markdown
Contributor

This PR includes the packaging scripts for the THINGS data and adds the necessary values to lookup.csv.

@mschrimpf mschrimpf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The only thing I would add are some unit tests to check e.g. that it's the right number of stimuli. See here for instance: https://github.com/brain-score/brain-score/blob/master/tests/test_benchmarks/test_igustibagus2024.py

Comment thread packaging/hebart2023/stimulus_set.py Resolved
@linus-md

linus-md commented Jan 4, 2024 •

Copy link
Copy Markdown
Contributor Author

@mschrimpf the tests should be passing now. I changed the DataAssembly and StimulusSet such that the stimulus_idis the image number in both. I also updated the lookup.csv with the added rows from the file in my virtual environment.

But there is apparently a problem with the hash:

=============================================================== short test summary info ================================================================
ERROR test_hebart2023.py - OSError: File '/Users/linussommer/.brainio/assy_Hebart2023/assy_Hebart2023.nc': invalid SHA-1 hash 90f66d37c202dcd1c74d82854efd4a1e8c5fe82e (expect...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================ 24 warnings, 1 error in 0.96s =============================================================

Ok never mind i just removed all the files from /.brainio and ran the test again. The data was downloaded from AWS but now this is happening.

================================================================== short test summary info ==================================================================
ERROR test_hebart2023.py - AttributeError: 'EntryPoints' object has no attribute 'get'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================== 25 warnings, 1 error in 56.23s ===============================================================

@linus-md

linus-md commented Jan 4, 2024 •

Copy link
Copy Markdown
Contributor Author

EDIT: Found brain-score/brainio#28.

To reproduce the error try:

import brainscore
assembly = brainscore.get_assembly(name='Hebart2023')
stimulus_set = assembly.attrs['stimulus_set']

which causes this

Loading catalog from entrypoints
Loading lookup from /Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainscore/lookup.csv
Traceback (most recent call last):
  File "/Users/linussommer/Documents/GitHub/brain-score/tests/test_benchmarks/test_temp.py", line 2, in <module>
    assembly = brainscore.get_assembly(name='Hebart2023')
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainscore/__init__.py", line 15, in get_assembly
    assembly = brainio_get_assembly(name)
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainio/fetch.py", line 168, in get_assembly
    assembly = loader.load()
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainio/assemblies.py", line 499, in load
    result = super(StimulusMergeAssemblyLoader, self).load()
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainio/assemblies.py", line 487, in load
    result = super(StimulusReferenceAssemblyLoader, self).load()
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/brainio/assemblies.py", line 459, in load
    result = xr.open_dataarray(self.file_path, group=self.group, chunks=chunks)
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/xarray/backends/api.py", line 666, in open_dataarray
    **kwargs,
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/xarray/backends/api.py", line 479, in open_dataset
    engine = plugins.guess_engine(filename_or_obj)
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/xarray/backends/plugins.py", line 110, in guess_engine
    engines = list_engines()
  File "/Users/linussommer/miniforge3/envs/brainscore/lib/python3.7/site-packages/xarray/backends/plugins.py", line 105, in list_engines
    entrypoints = entry_points().get("xarray.backends", ())
AttributeError: 'EntryPoints' object has no attribute 'get'

@linus-md

linus-md commented Jan 4, 2024 •

Copy link
Copy Markdown
Contributor Author

Apparently

import brainscore
stimulus_set = brainscore.get_stimulus_set(name='Hebart2023') 

is working and the test regarding the stimulus set is passing.

@mschrimpf
mschrimpf merged commit cd1df1e into brain-score:master Jan 4, 2024
mschrimpf added a commit that referenced this pull request Jan 4, 2024
@linus-md
linus-md deleted the packaging branch January 4, 2024 15:26
Nishant-codex pushed a commit to Nishant-codex/vision that referenced this pull request Jul 2, 2026
* Add Hebart Dataset

* fix test file naming

* fix test for number of columns and replace with set

* test matching stimulus ids

* Use correct stimulus_id in StimulusSet

* Update lookup.csv

* StimulusSet test are passing

* All tests are passing!!!

* fix expected columns

---------

Co-authored-by: Martin Schrimpf <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants