-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cnm.save() issue #673
Comments
@donglabimaging What's your version of CaImAn? |
@donglabimaging
|
@epnev Thank you for the suggestion. I will reproduce the error and post the error log tomorrow. I believe that I am using Caiman 1.0 |
@epnev Here is the error log.ValueError Traceback (most recent call last) ~\Anaconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\cnmf.py in save(self, filename) ~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in save_dict_to_hdf5(dic, filename, subdir) ~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in recursively_save_dict_contents_to_group(h5file, path, dic) ~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in recursively_save_dict_contents_to_group(h5file, path, dic) ValueError: Error while saving r_values |
@donglabimaging Thanks, can you tell me what the value of |
It is an array of values. I am just coping and pasting it, please let me know if you would like me to show it in a different way. array([ 0.25331816, 0. , 0.06987047, 0. , 0. , |
@donglabimaging No, this is helpful thanks. I'm wondering whether the existence of the NaN value causes the problems. Can you run the following command:
and then try to save the object again. Does that work? |
It worked! Thank you! Mind if I ask why is there a NaN instead of 0? |
Great! It's a good question why this happened; I don't have an immediate answer. |
Sounds good. Thanks again for the prompt response! I really appreciate your help!! |
Windows 10 Jupyter Notebook
Describe the issue that you are experiencing
We modify the demo_pipeline_cnmfE to run our analysis. We are experiencing similar issue as cnm2.save fails #427. It does not happen all the time. It only happens for certain imaging files.
Copy error log below
ValueError Traceback (most recent call last)
in
----> 1 cnm.save('28M_Day7_ImageJ_DS.hdf5')
~\Anaconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\cnmf.py in save(self, filename)
663
664 if '.hdf5' in filename:
--> 665 save_dict_to_hdf5(self.dict, filename)
666 else:
667 raise Exception("Filename not supported")
~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in save_dict_to_hdf5(dic, filename, subdir)
371
372 with h5py.File(filename, 'w') as h5file:
--> 373 recursively_save_dict_contents_to_group(h5file, subdir, dic)
374
375 def load_dict_from_hdf5(filename:str) -> Dict:
~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in recursively_save_dict_contents_to_group(h5file, path, dic)
458 h5file[path + key] = np.array(item)
459 elif type(item).name in ['CNMFParams', 'Estimates']: # parameter object
--> 460 recursively_save_dict_contents_to_group(h5file, path + key + '/', item.dict)
461 else:
462 raise ValueError("Cannot save %s type for key '%s'." % (type(item), key))
~\Anaconda3\envs\caiman\lib\site-packages\caiman\utils\utils.py in recursively_save_dict_contents_to_group(h5file, path, dic)
440 h5file[path + key] = item
441 if not np.array_equal(h5file[path + key].value, item):
--> 442 raise ValueError('The data representation in the HDF5 file does not match the original dict.')
443 # save dictionaries
444 elif isinstance(item, dict):
ValueError: The data representation in the HDF5 file does not match the original dict.
The text was updated successfully, but these errors were encountered: