xingyu-liu / coding_sparseness

0 stars 1 forks source link

failed to load database #2

Closed laurentperrinet closed 3 years ago

laurentperrinet commented 3 years ago

There is a missing documentation concerning the database used and I fail run the script:

❯ DNNBRAIN_DATA=. ipython activation_extraction.py
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~/quantic/timeline/2020-10-12_578158_Zhen_Manuscript_frontiers/coding_sparseness/activation_extraction.py in <module>
     50 dnn = eval('db_models.{}()'.format(net))  # load DNN
     51 stimuli = Stimulus()
---> 52 stimuli.load(stim_path) # load stimuli
     53 dmask = gen_dmask(layer_name)  # generate DNN mask
     54

/usr/local/lib/python3.8/site-packages/dnnbrain/dnn/core.py in load(self, fname)
     48         """
     49         stim_file = fio.StimulusFile(fname)
---> 50         stimuli = stim_file.read()
     51         self._data = stimuli.pop('data')
     52         self.header = stimuli

/usr/local/lib/python3.8/site-packages/dnnbrain/io/fileio.py in read(self)
     49         """
     50         # -load csv data-
---> 51         with open(self.fname) as rf:
     52             lines = rf.read().splitlines()
     53         # remove null line

FileNotFoundError: [Errno 2] No such file or directory: '/nfs/a1/userhome/liuxingyu/workingdir/coding_sparseness/imagenet.stim.csv'
❯ git pull
xingyu-liu commented 3 years ago

Hi Laurent,

Sorry for the bugs concerning absolute paths! I've checked and updated the code, and added some other necessary files as well. The DNNBrain and the local path of image datasets are required to extract the DCNN activation. Hope you can run it smoothly this time.

Xingyu

laurentperrinet commented 3 years ago

Looks good! Can you merge my pull request such that I can more easily integrate your changes in my fork?

xingyu-liu commented 3 years ago

No problem. Done.

xingyu-liu commented 3 years ago

Hi, Thanks for all the suggestion! I'm not quite sure what do you mean by 'Having different notebooks showing how you regenerate main figures would be beneficial.' In the latest jupyter-notebook version, I saperated several notebooks to regenerate main figures. Should you have any problem running it, please post it here. Thanks! Xingyu

laurentperrinet commented 3 years ago

thanks a lot. Indeed, I see the notebooks. Iwas suggesting to run the notebook (for instance https://github.com/xingyu-liu/coding_sparseness/blob/master/02_PSI_intact_model.ipynb ) such that it renders on GitHub. adding some information (for instance the corresponding caption from your paper) would certainly help readers to know more about your work!

xingyu-liu commented 3 years ago

Ah understood. Will do. Thanks!