Skip to content

UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes #17

@williamwongys

Description

@williamwongys

I encountered the above error. I have done some research and found the following:

"Typical error on Windows because the default user directory is C:\user<your_user>, so when you want to use this path as an string parameter into a Python function, you get a Unicode error, just because the \u is a Unicode escape. Any character not numeric after this produces an error.To solve it, just double the backslashes: C:\\user\<\your_user>..."

I checked the codes it is because of the lambda function in the generated model and the system tries to do a func_dump of modelgen.py in my c:\users\anaconda3\lib\site-packages\mcfly directory.

Any suggestion how to get around it?

Here is the detail trace:
File "C:\Users\pactera\Anaconda3\lib\site-packages\mcfly\storage.py", line 33, in savemodel
json_string = model.to_json() # save architecture to json string
File "C:\Users\pactera\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2541, in to_json
model_config = self._updated_config()
File "C:\Users\pactera\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2508, in _updated_config
config = self.get_config()
File "C:\Users\pactera\Anaconda3\lib\site-packages\keras\models.py", line 1179, in get_config
'config': layer.get_config()})
File "C:\Users\pactera\Anaconda3\lib\site-packages\keras\layers\core.py", line 668, in get_config
function = func_dump(self.function)
File "C:\Users\pactera\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 177, in func_dump
code = marshal.dumps(func.code).decode('raw_unicode_escape')
UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position 82-83: truncated \UXXXXXXXX escape

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions