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

If training is failing to start, and you are not receiving an error message telling you what to do, tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Training process. If you want to get tips, or better understand the Training process, then you should look in the Training Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
kitalian
Posts: 2
Joined: Thu Jan 14, 2021 12:26 pm

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

Post 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

User avatar
torzdf
Posts: 2679
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 133 times
Been thanked: 625 times

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

Post 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.

My word is final

User avatar
torzdf
Posts: 2679
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 133 times
Been thanked: 625 times

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

Post 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.

My word is final

User avatar
kitalian
Posts: 2
Joined: Thu Jan 14, 2021 12:26 pm

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

Post 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?

User avatar
bryanlyon
Site Admin
Posts: 793
Joined: Fri Jul 12, 2019 12:49 am
Answers: 44
Location: San Francisco
Has thanked: 4 times
Been thanked: 218 times
Contact:

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

Post by bryanlyon »

Locked