faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Model not valid

Open fetchlister opened this issue 8 years ago • 6 comments

I have recieved trained models from friends before for deepfaking but recently I have been getting errors saying that the model isn't valid. eg

Dimension 1 in both shapes must be equal, but are 1024 and 512 for 'Assign_8' (op: 'Assign') with input shapes: [16384,1024], [16384,512]. Model Not Found! A valid model must be provided to continue!

These models are made by windows users ostensibly using fakeapp 1.1, is there any way to fix this error? I've definately used fakeapp 1.1 models in the past. any help would be appreciated.

fetchlister avatar Mar 15 '18 16:03 fetchlister

I haven't looked at the code too much but perhaps the model was trained using the LowMem model and you're trying to use the original converter. I believe fakeapp 1.1 is quite dated now (don't quote me on that) so I suggest training on the most recent commit.

andykdy avatar Mar 15 '18 16:03 andykdy

Try LowMem model, maybe you can have luck with it. Otherwise note that FakeApp has options not documented and not available here so it possible that you can't use them with code from this repo

Clorr avatar Mar 15 '18 23:03 Clorr

I can confirm that a model trained with LowMem will show an error like that when attempting to use the Original trainer. The 1024 is what the trainer is expecting, and the 512 is what the model has been trained with previously. There could be other problems, like a number of layers mismatch, but it's the Encoder_Dim on line 15 of the Model.py that's causing that error specifically.

MT-4ier avatar Mar 16 '18 05:03 MT-4ier

How would I correct for layers? @MT-4ier

fetchlister avatar Mar 16 '18 08:03 fetchlister

I think the Original model uses 7 layers, and the standard LowMem model uses 6 layers. The LowMem model has removed line 57 from the Original, which is x = self.conv(1024)(x). If the LowMem model has too few layers to match the models you've been given, you can add in that line. If it has too many layers, you can comment out some self.conv lines with the number symbol #.

MT-4ier avatar Mar 16 '18 09:03 MT-4ier

@fetchlister you can use LowMem by using -t LowMem on command line. Otherwise, you will have to modify the code. But if you don't know which model configuration was used to produce the file you have, it may be a hard guess work

Clorr avatar Mar 16 '18 10:03 Clorr