spinaotey / snl_tf

Sequential Neural Likelihood - Tensorflow Implementation
Other
2 stars 1 forks source link

pickling files #2

Open ybernaerts opened 5 years ago

ybernaerts commented 5 years ago

I want to use the util.io.load() function to load a .pkl (pickled) file. I think that in Python3 however we need the 'wb' or 'rb' option to write (dump) and read (load) a pickle file respectively. I used this, however, and it still doesn't work to load the 'whiten_params.pkl' file under the data/simulators/hodgkin_huxley folder of the original snl package. I continue to get the error: "'utf-8' codec can't decode byte 0xbd in position 0: invalid start byte". I keep on trying different things but to no avail so far.

spinaotey commented 5 years ago

What are you trying to load? I'm not using the util functions personally, so I can't really help there.

ybernaerts commented 5 years ago

ok no worries. Since the util folder is part of your snl_tf package, I still think it makes sense to change the 'w' and 'r' to 'wb' and 'rb' in the util/io.py script where one loads pickled files since otherwise it definitely won't work in Python3.

ybernaerts commented 5 years ago

Here's my file I'm trying to load. .pkl extensions I can't drag in here apparantly, but normally it would have an .pkl extension. stats_whitening_params.txt

ybernaerts commented 5 years ago

I think I will just write my own function to whiten the data ;)