Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faceswap error regularizers is not defined #153

Open
Alkatraz91 opened this issue Dec 6, 2019 · 5 comments
Open

faceswap error regularizers is not defined #153

Alkatraz91 opened this issue Dec 6, 2019 · 5 comments

Comments

@Alkatraz91
Copy link

hello i got this error an not understand what it means

NameError Traceback (most recent call last)
in ()
----> 1 model = FaceswapGANModel(**arch_config)

2 frames
/content/faceswap-GAN/networks/nn_blocks.py in conv_block(input_tensor, f, use_norm, strides, w_l2, norm)
126 def conv_block(input_tensor, f, use_norm=False, strides=2, w_l2=w_l2, norm='none'):
127 x = input_tensor
--> 128 x = Conv2D(f, kernel_size=3, strides=strides, kernel_regularizer=regularizers.l2(w_l2),
129 kernel_initializer=conv_init, use_bias=False, padding="same")(x)
130 x = Activation("relu")(x)

NameError: name 'regularizers' is not defined

@hafizas101
Copy link

Create a new cell and write the following code
from keras import regularizers
It will solve issue. If it doesn't then write the same code in /networks/nn_blocks.py file

@Alkatraz91
Copy link
Author

Alkatraz91 commented Dec 7, 2019

i not know were t oadd that line. today i w trying again but i got a different error:
NameError Traceback (most recent call last)
in ()
----> 1 model = FaceswapGANModel(**arch_config)

2 frames
/content/faceswap-GAN/networks/nn_blocks.py in conv_block(input_tensor, f, use_norm, strides, w_l2, norm)
126 def conv_block(input_tensor, f, use_norm=False, strides=2, w_l2=w_l2, norm='none'):
127 x = input_tensor
--> 128 x = Conv2D(f, kernel_size=3, strides=strides, kernel_regularizer=regularizers.l2(w_l2),
129 kernel_initializer=conv_init, use_bias=False, padding="same")(x)
130 x = Activation("relu")(x)

NameError: name 'regularizers' is not defined

after the code :model = FaceswapGANModel(**arch_config)

i hav put the code u gave me right before that code but still nothing.i not know how to do the second method.
edit: i think i hve done the second method too but still got the same error not know wht to do

@Alkatraz91 Alkatraz91 changed the title faceswap error faceswap error regularizers is not defined Dec 7, 2019
@interactivetech
Copy link

I am able to get the colab notebook to see the from keras import regularizers by restarting the runtime. Not the best solution but after restarting, the colab sees the new import

@wiki-lai
Copy link

make sure you are using tensorflow1.8.0 and install tensorflow-gpu1.8.0 , and downgrade cuda to 9.0 .

@CL791
Copy link

CL791 commented Apr 28, 2021

downgrade keras

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants