'NoneType' object has no attribute 'shape'

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
poldned34
Posts: 6
Joined: Wed May 12, 2021 10:00 am
Answers: 1
Has thanked: 3 times
Been thanked: 1 time

'NoneType' object has no attribute 'shape'

Post by poldned34 »

Hi everyone.
Recently become supporter on patreon and updated to the latest version. Before an update I successfully used some of the old versions (not the one released August 2020, but previous one).

The problem - every 30-60 minutes my training process crash with ['NoneType' object has no attribute 'shape'] error.
Except this, looks like model is learning as it should.

I would be really thankful for any help.

I tried:

  1. Recreate model from scratch
  2. To use other model plugin (using Phaze-A, tried switch to unbalanced).
  3. Manually checked all of my faces (just visual check that images are not obviously corrupted).
  4. Split all my A and B faces to 4 folders. Then, tried to run model from scratch with one half of faces firstly, then to run new model with other half of faces.
  5. Reextracted all of my faces (using old alignments)

None of this resolved my problem.

Aligments of face B was updated from old faceswap version. Face A alignments are new.
I tried to find bad faces in log file by checking faces that was loaded in model just before crash, but, it seems that its always different faces, and they all look completely valid.

I don't see how to upload a log file here on the forum, so I uploaded it here: https://dropfiles.org/XOJnqKxq
Let me know if I need to upload it some other way.

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: 'NoneType' object has no attribute 'shape'

Post by torzdf »

First up, many thanks for your support, it is hugely appreciated. Be sure to check out our Discord as there are exclusive supporter areas there.

There is indeed an issue with at least one of your training images. Unfortunately the issue you have hit is inside the code which is meant to tell you which image is causing the issue :ugeek:

I have just pushed an update to hopefully fix this.

If you go Help > Update Faceswap. Close the app, re-open, it will hopefully tell you where the issue lies.

My word is final

User avatar
poldned34
Posts: 6
Joined: Wed May 12, 2021 10:00 am
Answers: 1
Has thanked: 3 times
Been thanked: 1 time

Re: 'NoneType' object has no attribute 'shape'

Post by poldned34 »

Thank you for such fast response!

Updated to new version, hopefully, it will help me to find cause of my problem.

User avatar
poldned34
Posts: 6
Joined: Wed May 12, 2021 10:00 am
Answers: 1
Has thanked: 3 times
Been thanked: 1 time

Re: 'NoneType' object has no attribute 'shape'

Post by poldned34 »

Logs become morre informative, thank you. I found few 'bad' faces and removed them.

But, Is it possible that update break something?
I have new problem.
Training crash every 10-15 minutes with this error:
05/14/2021 13:15:05 ERROR There are mismatched image sizes in the folder 'F:\c\f_new'. All training images for each side must have the same dimensions.
05/14/2021 13:15:05 ERROR The batch that failed contains the following files:
05/14/2021 13:15:05 ERROR ['10_070801_0.png (1024px)', <class 'NoneType'>, '7_029351_0.png (1024px)', '12_011101_0.png (1024px)'].

All my images are 1024x1024, I rechecked this. And I never faced this error before yesteray update.
No logs file attached, since this error don't generate crash reports.

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: 'NoneType' object has no attribute 'shape'

Post by torzdf »

The image size isn't the issue, some of your images are failing to load (maybe corruption of some kind?).

The update was meant to say which image fails to load, but I managed to omit it.

Just pushed an update which should lead you to the problematic image.

My word is final

User avatar
poldned34
Posts: 6
Joined: Wed May 12, 2021 10:00 am
Answers: 1
Has thanked: 3 times
Been thanked: 1 time

Re: 'NoneType' object has no attribute 'shape'

Post by poldned34 »

Ok, thank you for all your help.

My current idea is that my hdd with image sets slowly started to become corrupted.
This hdd is pretty old, so there is good chance that it's time has come.

Don't see other explanation why so many images become corrupted.

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: 'NoneType' object has no attribute 'shape'

Post by torzdf »

If you have confirmed that the images are corrupted, then we're golden (well, you aren''t, but you know what I mean).

If you can't find an issue with the images, then feel free to DM me one of the "corrupted" images so I can see if there is an issue with the code.

My word is final

Locked