soltanianzadeh / STNeuroNet

Software for the paper "Fast and robust active neuron segmentation in two-photon calcium imaging using spatio-temporal deep learning," Proceedings of the National Academy of Sciences (PNAS), 2019.
https://www.pnas.org/content/early/2019/04/10/1812995116
Apache License 2.0
60 stars 26 forks source link

Missing checkpoint folder #9

Closed hluetck closed 5 years ago

hluetck commented 5 years ago

Hello, I am trying to run the demo_inference_neurofinder.py script with the Neurofinder 400 example dataset. When calling niftynet.main() I get the following error:

CRITICAL:niftynet: /home/luetcke/Analysis/models/Neurofinder/Trained Network Weights/neurofinder/models/checkpoint not found, please checkconfig parameter: model_dir
CRITICAL:niftynet: failed to get iteration numberfrom checkpoint path
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-248850c9cfa6> in <module>
      1 sys.argv=['','inference','-a','net_segment','--conf',os.path.join('config_inf_neuro.ini'),'--batch_size','1']
----> 2 niftynet.main()

~/.conda/envs/stneuronet/lib/python3.6/site-packages/niftynet/__init__.py in main()
     53     app_driver = ApplicationDriver()
     54     app_driver.initialise_application(system_param, input_data_param)
---> 55     app_driver.run_application()
     56     return 0

~/.conda/envs/stneuronet/lib/python3.6/site-packages/niftynet/engine/application_driver.py in run_application(self)
    148 
    149             tf.logging.info('starting from iter %d', self.initial_iter)
--> 150             self._rand_init_or_restore_vars(session)
    151 
    152             # start samplers' threads

~/.conda/envs/stneuronet/lib/python3.6/site-packages/niftynet/engine/application_driver.py in _rand_init_or_restore_vars(self, sess)
    272         else:
    273             try:
--> 274                 checkpoint = ckpt_state.model_checkpoint_path
    275                 # ADDED to fix the absolute path problem
    276                 INDX = checkpoint.find('model.')

AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'

The folder /home/luetcke/Analysis/models/Neurofinder/Trained Network Weights/neurofinder/models/checkpoint does not exist. Should it be created at some point before?

Thanks for your help.

soltanianzadeh commented 5 years ago

@hluetck have you downloaded the model weights from https://github.com/soltanianzadeh/STNeuroNet/tree/master/models ? If so, make sure the "models" folder is in the same folder as demo_inference_neurofinder.py.

hluetck commented 5 years ago

Dear @soltanianzadeh yes, I have the models folder in the same folder as demo_inference_neurofinder.py. But I specified the wrong folder in DirModel. Now it works. Thanks for your help!