here: https://github.com/fchollet/keras/pull/3012 serialization was fixed for lambda layer by adding: .decode('raw_unicode_escape')
however if the code is in a folder or filename starting with the letter u or U, you get \u in the string due to windows notation. for example:
<code object <lambda> at 0x0000000014BEBD20, file "C:\Users\python\u_is_first_letter.py", line 10>
the decode then gives an error as:
UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position ..-..: truncated \uXXXX
apparently this is a python 3 issue. see here: https://bugs.python.org/issue19539
this is on latest master of theano and keras
a quick patch i am using in generic_utils.py/func_dump(func) is:
code = marshal.dumps(func.__code__).replace(b'\\',b'/').decode('raw_unicode_escape')
please reopen. this is still an issue. i missed the stale tag.
I have the same issue when trying to save best weights during training. Please reopen the issue!
Most helpful comment
a quick patch i am using in generic_utils.py/func_dump(func) is:
code = marshal.dumps(func.__code__).replace(b'\\',b'/').decode('raw_unicode_escape')