a 'utf-8' codec problem

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
weenween24
Posts: 1
Joined: Wed Oct 26, 2022 2:11 am

a 'utf-8' codec problem

Post by weenween24 »

Newbie here. Always caught this error couple of hours into training. I tried to make sure all the paths had no special characters in them. But it seems like something else.

Code: Select all

10/25/2022 19:35:23 MainProcess     _training_0                    multithreading  run                            DEBUG    Error in thread (_training_0): 'utf-8' codec can't decode byte 0xc9 in position 183: invalid continuation byte
10/25/2022 19:35:24 MainProcess     MainThread                     train           _monitor                       DEBUG    Thread error detected
10/25/2022 19:35:24 MainProcess     MainThread                     train           _monitor                       DEBUG    Closed Monitor
10/25/2022 19:35:24 MainProcess     MainThread                     train           _end_thread                    DEBUG    Ending Training thread
10/25/2022 19:35:24 MainProcess     MainThread                     train           _end_thread                    CRITICAL Error caught! Exiting...
10/25/2022 19:35:24 MainProcess     MainThread                     multithreading  join                           DEBUG    Joining Threads: '_training'
10/25/2022 19:35:24 MainProcess     MainThread                     multithreading  join                           DEBUG    Joining Thread: '_training_0'
10/25/2022 19:35:24 MainProcess     MainThread                     multithreading  join                           ERROR    Caught exception in thread: '_training_0'
Traceback (most recent call last):
  File "D:\Software\faceswap\lib\cli\launcher.py", line 182, in execute_script
    process.process()
  File "D:\Software\faceswap\scripts\train.py", line 190, in process
    self._end_thread(thread, err)
  File "D:\Software\faceswap\scripts\train.py", line 230, in _end_thread
    thread.join()
  File "D:\Software\faceswap\lib\multithreading.py", line 121, in join
    raise thread.err[1].with_traceback(thread.err[2])
  File "D:\Software\faceswap\lib\multithreading.py", line 37, in run
    self._target(*self._args, **self._kwargs)
  File "D:\Software\faceswap\scripts\train.py", line 252, in _training
    raise err
  File "D:\Software\faceswap\scripts\train.py", line 242, in _training
    self._run_training_cycle(model, trainer)
  File "D:\Software\faceswap\scripts\train.py", line 327, in _run_training_cycle
    trainer.train_one_step(viewer, timelapse)
  File "D:\Software\faceswap\plugins\train\trainer\_base.py", line 193, in train_one_step
    loss = self._model.model.train_on_batch(model_inputs, y=model_targets)
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1695, in train_on_batch
    logs = train_function(iterator)
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in __call__
    result = self._call(*args, **kwds)
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\def_function.py", line 807, in _call
    return self._stateless_fn(*args, **kwds)  # pylint: disable=not-callable
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\function.py", line 2829, in __call__
    return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\function.py", line 1843, in _filtered_call
    return self._call_flat(
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\function.py", line 1923, in _call_flat
    return self._build_call_outputs(self._inference_function.call(
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\function.py", line 545, in call
    outputs = execute.execute(
  File "D:\Software\envs\faceswap\lib\site-packages\tensorflow\python\eager\execute.py", line 59, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 183: invalid continuation byte[mono][/mono]
User avatar
torzdf
Posts: 2672
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: a 'utf-8' codec problem

Post by torzdf »

I have not seen this issue before. It appears to be happening inside Tensorflow which is strange. Check that the paths to your model folder don't contain any special characters is the best advice I can give at the moment.

My word is final

Locked