faceswap-GAN
faceswap-GAN copied to clipboard
faceswap error regularizers is not defined
hello i got this error an not understand what it means
NameError Traceback (most recent call last)
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
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
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)
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
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
make sure you are using tensorflow1.8.0 and install tensorflow-gpu1.8.0 , and downgrade cuda to 9.0 .
downgrade keras