Solution to convert error: invalid value encountered in rint patched_face = np.rint

Getting errors or found a bug when converting faces from a trained model? Post about them here


Forum rules

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

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

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

Locked
User avatar
fscjp
Posts: 3
Joined: Thu Jan 05, 2023 11:32 am
Been thanked: 1 time

Solution to convert error: invalid value encountered in rint patched_face = np.rint

Post by fscjp »

During two separate training sessions I've received the following error during the convert process:

C:\Users\fs\faceswap_amd\lib\convert.py:197: RuntimeWarning: invalid value encountered in rint
patched_face = np.rint(patched_face,...

This results in black boxes being shown over the swapped face. The issue is only present during convert and not evident during training since everything appears normal.

I read in some previous posts that this was likely due to a NaN somewhere in the model and that the session is corrupted with little hope of recovery. I did run the model through Nan-Scan which did not uncover any issues.

Being curious as to why the training process showed no signs of problems, I modified the training configuration to disable Mixed Precision and then reran the training for as many iterations to ensure a [Saved model] step was run at least twice.

I then reran the conversion and the rint warning/error disappeared. I was able to convert successfully and continue training with no loss in progress or data.

Hope this helps some else out there that might run into this same issue.

Locked