AttributeError: Can't pickle local object 'new_dist_class.<locals>.new_class'

255 views
Skip to first unread message

Seth Allen

unread,
Feb 15, 2021, 4:47:51 PM2/15/21
to hddm-users
Hi there, 

I'm struggling to save models using the Hrl package, I'm generating the model as follows: m_rl = hddm.Hrl(data, dual=True, depends_on={'v':'dbs', 'pos_alpha':'dbs', 'alpha':'dbs'}) m_rl.sample(5000,burn=500, dbname='traces.db', db='pickle') m_rl.print_stats() 

and then I try to save using: m_rl.save('HRL_MODEL') 

however, I get the following error: 

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\sallen\anaconda3\envs\HDDM3.6\lib\site-packages\kabuki\hierarchical.py", line 412, in save pickle.dump(self, open(fname, 'wb')) AttributeError: Can't pickle local object 'new_dist_class.<locals>.new_class' 

Greatly appreciate any help, 
Seth

Mads Lund Pedersen

unread,
Feb 16, 2021, 4:51:51 AM2/16/21
to hddm-...@googlegroups.com
Unfortunately, RL and RLDDM models can't be saved. As an alternative, I'd recommend saving the traces to a csv. 

--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/8f835202-b6a7-4aed-9151-e5ae0faee458n%40googlegroups.com.


--
Best, 
Mads
Reply all
Reply to author
Forward
0 new messages