Page 1 of 1

lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0)

Posted: Thu Jan 14, 2021 12:47 pm
by kitalian

The computer crashed and I reset it. Meanwhile, the application was running. When I turned it back on I got the following error

Code: Select all

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\PC\faceswap\lib\serializer.py", line 166, in unmarshal
    retval = self._unmarshal(serialized_data)
  File "C:\Users\PC\faceswap\lib\serializer.py", line 212, in _unmarshal
    return json.loads(data.decode("utf-8"))
  File "C:\Users\PC\MiniConda3\envs\faceswap\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\PC\MiniConda3\envs\faceswap\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\PC\MiniConda3\envs\faceswap\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\PC\MiniConda3\envs\faceswap\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "C:\Users\PC\faceswap\lib\gui\display_analysis.py", line 143, in _populate_from_folder
    self._load_session(full_path=os.path.join(folder, state_file))
  File "C:\Users\PC\faceswap\lib\gui\display_analysis.py", line 248, in _load_session
    Session.initialize_session(model_dir, model_name, is_training=False)
  File "C:\Users\PC\faceswap\lib\gui\stats.py", line 124, in initialize_session
    self._load_state_file()
  File "C:\Users\PC\faceswap\lib\gui\stats.py", line 89, in _load_state_file
    self._state = serializer.load(state_file)
  File "C:\Users\PC\faceswap\lib\serializer.py", line 109, in load
    retval = self.unmarshal(data)
  File "C:\Users\PC\faceswap\lib\serializer.py", line 170, in unmarshal
    raise FaceswapError(msg) from err
lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0)

How can I solve the problem?

Thank you for your help in advance


Re: lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0

Posted: Thu Jan 14, 2021 12:50 pm
by torzdf

When does this happen? What are you trying to do? Do you have a crash report in your faceswap folder, if so, please supply it.


Re: lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0

Posted: Thu Jan 14, 2021 12:50 pm
by torzdf

If this happens when trying to resume training, then most ikely your PC shutdown when the model was saving and it corrupted.

If so, use the backup tool to restore your model.


Re: lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0

Posted: Thu Jan 14, 2021 2:57 pm
by kitalian
torzdf wrote: Thu Jan 14, 2021 12:50 pm

If this happens when trying to resume training, then most ikely your PC shutdown when the model was saving and it corrupted.

If so, use the backup tool to restore your model.

How can I do the restore?


Re: lib.utils.FaceswapError: Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0

Posted: Thu Jan 14, 2021 4:00 pm
by bryanlyon