Closed hubhubhang closed 6 years ago
I do have a HDF5 file called "cnn_model.h5" in my package location, but the program is unable to read it.
@hubhubhang What is your matlab version? Do you encounter the same error as described here?
My MATLAB version is R2018a. I will check the link tonight.
I've just checked (using the command from that link), my HDF5 library version is
[ver_major,ver_minor,ver_patch] = H5.get_libversion ver_major = 1 ver_minor = 8 ver_patch = 12
And I've tried both running the codes "h5disp('swmr_test.h5')" and "h5disp('cnn_model.h5')". In both cases, I am encountering the same error as in the link you sent.
@hubhubhang I'm not sure what's wrong. I tried with many different MATLAB versions, including R2018a. In all cases I get same the library version as you
[ver_major,ver_minor,ver_patch] = H5.get_libversion ver_major = 1 ver_minor = 8 ver_patch = 12
but the file is read without any problems. Is the cnn_model.h5
located in your main CaImAn-MATLAB folder?
Yes, I checked that cnn_model.h5 is located in my main CaImAn-MATLAB folder.
Maybe it's because the older version of HDF5 library still remain in your computer even after you installed R2018a?
Anyway, I can try to first use the format converting tools from the link you provided and see if it works. I will keep you posted. Thanks.
I'll see if I can try on a clean machine see if that's the reason.
In the meantime, you can also bypass this step as the code suggests.
@hubhubhang I also tried on a clean windows machine with a single matlab installation and it worked fine again with the same version of the HDF5 library
I found the reason why not working.
I put my CaImAn-MATLAB folder on Dropbox and ran the calculation there, so there may be some synchronization problem due to Dropbox causing the download of the "cnn_model.h5" not complete. The size of "cnn_model.h5" downloaded when running the calculation on Dropbox is just 8872KB.
Then, I went to "cnn_classifier.m" and download the "cnn_model.h5" directly using the Dropbox link provided there. And then the size of the "cnn_model.h5" I downloaded is now 26,164KB, which I think it's the size of the complete file. I put this 26,164KB "cnn_model.h5" in the CaImAn-MATLAB folder manually and then the error message I saw has gone now.
FYI, I did try the suggestion in the link you sent above, but it's a bit complicated so I stopped and went to double check the download of the "cnn_model.h5" first.
Thanks again for the help.
Thanks for the update, glad it's working now.
Error in cnn_classifier (line 46) net_classifier = importKerasNetwork(classifier,'ClassNames',["rejected","accepted"]);
Error in CNMF/CNNClassifier (line 250) [obj.keep_cnn,obj.val_cnn] = cnn_classifier(obj.A,obj.dims,classifier,obj.options.cnn_thr);
Error in CNMF/fit (line 396) obj.CNNClassifier('cnn_model.h5');
Error in run_CNMF_patches>process_patch_object (line 386) CNM.fit(Y,options,K);
Error in run_CNMF_patches (line 105) parfor i = 1:n_patches
Error in demo_patches_512x512x6810_trial1 (line 62) [A,b,C,f,S,P,RESULTS,YrA] = run_CNMF_patches(data,K,patches,tau,p,options);