unable to train and convert or preview model

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.

Post Reply
User avatar
Posts: 2
Joined: Wed Feb 10, 2021 3:58 am

unable to train and convert or preview model

Post by 85lesbian »

i get this error when i load the project

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\denye\faceswap\lib\serializer.py", line 166, in unmarshal
retval = self._unmarshal(serialized_data)
File "C:\Users\denye\faceswap\lib\serializer.py", line 212, in _unmarshal
return json.loads(data.decode("utf-8"))
File "C:\Users\denye\MiniConda3\envs\faceswap\lib\json\__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\denye\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\denye\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\denye\MiniConda3\envs\faceswap\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "C:\Users\denye\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\denye\faceswap\lib\gui\display_analysis.py", line 248, in _load_session
Session.initialize_session(model_dir, model_name, is_training=False)
File "C:\Users\denye\faceswap\lib\gui\stats.py", line 124, in initialize_session
File "C:\Users\denye\faceswap\lib\gui\stats.py", line 89, in _load_state_file
self._state = serializer.load(state_file)
File "C:\Users\denye\faceswap\lib\serializer.py", line 109, in load
retval = self.unmarshal(data)
File "C:\Users\denye\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)

and when trying to train the model i get this

02/12/2021 16:00:26 CRITICAL Error caught! Exiting...
02/12/2021 16:00:26 ERROR Caught exception in thread: '_training_0'
02/12/2021 16:00:26 ERROR Error unserializing data for type <class 'bytes'>: Expecting value: line 1 column 1 (char 0)
Process exited.

so pls help me

User avatar
Posts: 94
Joined: Sat Jan 18, 2020 6:32 pm
Has thanked: 13 times
Been thanked: 28 times

Re: unable to train and convert or preview model

Post by cosmico »

I'm by no means an expert, but when I run into

Code: Select all

CRITICAL Error caught! Exiting...
ERROR Caught exception in thread: '_training_0'

I first check to make sure that all my setting are right. Sometimes I have the wrong model selected from a previous project where I used a different model or sometimes I don''t have a timelapse folder assigned when I'm using timelapse. Then The thing that usually solves the problem for me is restoring the model from backup
select you model's path exactly like you would if you were choosing the model path for training or conversion, and then it fixes it. As far as my understanding goes, restoring your model from backup doesn't harm it in anyway, but if you want to be extra cautious, you can just make a copy of your entire model in windows explorer.

I'm pretty sure mods want you to post help in the extraction, training, conversion forums, and
pro tip: If you are concerned about privacy, before you copy and paste code online, you should first check if it has your name on it like: ""C:\Users\denye\" and either rename it or delete the name

User avatar
Site Admin
Posts: 596
Joined: Fri Jul 12, 2019 12:49 am
Answers: 40
Location: San Francisco
Has thanked: 3 times
Been thanked: 153 times

Re: unable to train and convert or preview model

Post by bryanlyon »

Can't be sure since you didn't post a crashlog, but that last message looks like a corrupt model file. If so, you can try to use the restore tool to go back to a previous version.

Please post the crashlog if that's not it.

Your first error is a GUI glitch that happens (particularly when the model is corrupt) and usually just restarting the GUI will fix it.

Also, like Cosmico said, I moved this to the training support forum.

Post Reply