-
Notifications
You must be signed in to change notification settings - Fork 370
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
Reloading cnmf object returns bytes rather than string #1264
Comments
Thanks I'll check this out. |
I reproduced this : definitely a problem if you try to change params on loaded cnmf object it gets angry because of the way it's represented. Not sure when we'll fix this, but a fix is definitely needed, thanks for pointing it out. |
Thanks Eric! |
Oh I just ran into something related to this because a parameter with the value |
Although actually looking at that PR #1305, if I'm modifying |
Longer-term I think it'd be good to have all initialisers force everything to the exact type expected for whatever's being filled in, rather than whatever the serialisation expects. This will be a lot of work, but it will eliminate a source of unwanted variance in the code. |
OK, I agree converting all the bytes arrays to strings would not work actually. Looking closer, I now see that it's specifically lists of strings or objects that can't be directly saved to an HDF5 dataset (such as slices), since scalar strings are stored as attributes. The one case I found where converting to strings would be incorrect is
I guess the thing to do here would be to convert it back using Also just want to note that |
Sorry I was wrong - I forgot that all strings are getting loaded as |
When reloading the CNMFE model using
load_CNMF
, thecnmfe_model.params.data[fnames]
is of type numpy.bytes and requires a reset prior to changing parameters and evaluating componentscnmfe_model.params.data['fnames'] = [cnmfe_model.params.data['fnames'][0].decode('UTF-8')]
The text was updated successfully, but these errors were encountered: