KamitaniLab / GenericObjectDecoding

Demo code for Horikawa and Kamitani (2017) Generic decoding of seen and imagined objects using hierarchical visual features. Nat Commun https://www.nature.com/articles/ncomms15037.
150 stars 46 forks source link

error when running analysis_FeaturePrediction.py #7

Closed FerociousPanda closed 6 years ago

FerociousPanda commented 6 years ago

Hi, I use python2 and Macbook to run the code, but I get the following error, could you have a look?

Many thanks.

File "analysis_FeaturePrediction.py", line 307, in <module>
    main()
  File "analysis_FeaturePrediction.py", line 75, in main
    data_feature = bdpy.BData(image_feature)
  File "/Users/Pan/Downloads/GenericObjectDecoding/code/python/env2/lib/python2.7/site-packages/bdpy/bdata/bdata.py", line 72, in __init__
    self.load(file_name, file_type)
  File "/Users/Pan/Downloads/GenericObjectDecoding/code/python/env2/lib/python2.7/site-packages/bdpy/bdata/bdata.py", line 558, in load
    self.__load_h5(load_filename)
  File "/Users/Pan/Downloads/GenericObjectDecoding/code/python/env2/lib/python2.7/site-packages/bdpy/bdata/bdata.py", line 700, in __load_h5
    md_keys = dat["metadata"]['key'][:].tolist()
  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 "/Users/Pan/Downloads/GenericObjectDecoding/code/python/env2/lib/python2.7/site-packages/h5py/_hl/group.py", line 167, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  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/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'metadata' doesn't exist)"
ShuntaroAoki commented 6 years ago

It seems you're missing appropriate data files. Please try:

  1. create data directory at the same directory with the python scripts.
  2. download the following files from http://brainliner.jp/data/brainliner/Generic_Object_Decoding and put them in the data directory.
    • Subject*.mat
    • ImageFeatures.h5 (not 'mat' file)
    • If you've already have the files, please confirm they are valid (followings are md5 hash for the files)
      • 4d2104e1bbb86827b309af18ef030b29 Subject1.mat
      • 9892f5c840df5203291b3267dc6f6793 Subject2.mat
      • b2d8b5a62d1f1c8b47eb1ef7ae83d68c Subject3.mat
      • 8675f185cf52cc57421a4729fe514e87 Subject4.mat
      • 79aa4e1c71008b42340e0ac79be2ba64 Subject5.mat
      • e4f084088a9c3f391f1b093f70d29e8a ImageFeatures.h5
  3. run the script