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

How to run the code on multi gpus? #2

Open
mvoofan opened this issue Oct 29, 2021 · 2 comments
Open

How to run the code on multi gpus? #2

mvoofan opened this issue Oct 29, 2021 · 2 comments

Comments

@mvoofan
Copy link

mvoofan commented Oct 29, 2021

This project is a fantastic work on non-surpervised clustring.

However, OOM (out of memory) errors appeared when I attempted to run the codes with my own data (feather size per sample > 20000). Then I tried to solve the problem by running the codes on multi gpus, and added the following data in 'Conv.py'.

    self.train_step1_keras=tf.keras.optimizers.Adam()
    self.train_step1_keras.minimize(  self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )

def fit_defense(self, x_train_unlabeled,x_dy,x_dy1,batch_size):
    defense_model_parrarel=multi_gpu_model(self.defense_model, gpus = self.gpu)
    defense_model_parrarel.compile(optimizer=self.train_step1_keras)
    defense_model_parrarel.fit(x=[ x_train_unlabeled,x_dy,x_dy1], batch_size=batch_size, steps_per_epoch=100 )

Then " returned a result with an error set" error appeared when calling "self.train_step1_keras.minimize( self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )".

I wonder if anyone can provide any suggestions on running the code on multi gpus.

@LYK-love
Copy link

    self.train_step1_keras=tf.keras.optimizers.Adam()
    self.train_step1_keras.minimize(  self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )

def fit_defense(self, x_train_unlabeled,x_dy,x_dy1,batch_size):
    defense_model_parrarel=multi_gpu_model(self.defense_model, gpus = self.gpu)
    defense_model_parrarel.compile(optimizer=self.train_step1_keras)
    defense_model_parrarel.fit(x=[ x_train_unlabeled,x_dy,x_dy1], batch_size=batch_size, steps_per_epoch=100 )

Then " returned a result with an error set" error appeared when calling "self.train_step1_keras.minimize( self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )".

I wonder if anyone can provide any suggestions on running the

Hi bro, i also fork this project today. However, i found the sentence "import cv2 " in **/src/applications/ADDC.py. And i can't find this module online or in the files downloaded. I strongly doubt that the "cv2" is written locally and was never uploaded., which means the code can never be runned by just typing "python run.py ". However, i saw you made this issue which inpliied you just run the code successfully on the original dataset. I wonder that how do you make it? Did you write your own cv2 or its just something wrong with me?

@mvoofan
Copy link
Author

mvoofan commented Nov 20, 2021

    self.train_step1_keras=tf.keras.optimizers.Adam()
    self.train_step1_keras.minimize(  self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )

def fit_defense(self, x_train_unlabeled,x_dy,x_dy1,batch_size):
    defense_model_parrarel=multi_gpu_model(self.defense_model, gpus = self.gpu)
    defense_model_parrarel.compile(optimizer=self.train_step1_keras)
    defense_model_parrarel.fit(x=[ x_train_unlabeled,x_dy,x_dy1], batch_size=batch_size, steps_per_epoch=100 )

Then " returned a result with an error set" error appeared when calling "self.train_step1_keras.minimize( self.loss_defense,var_list=[self.vae.weights,self.Discriminator.weights] )".
I wonder if anyone can provide any suggestions on running the

Hi bro, i also fork this project today. However, i found the sentence "import cv2 " in **/src/applications/ADDC.py. And i can't find this module online or in the files downloaded. I strongly doubt that the "cv2" is written locally and was never uploaded., which means the code can never be runned by just typing "python run.py ". However, i saw you made this issue which inpliied you just run the code successfully on the original dataset. I wonder that how do you make it? Did you write your own cv2 or its just something wrong with me?

it is the "opencv-python" package~

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

2 participants