xxlya / Fed_ABIDE

impelmentation of https://arxiv.org/pdf/2001.05647.pdf
30 stars 10 forks source link

Error in backpropagation for federated_align #2

Open ameliajimenez opened 3 years ago

ameliajimenez commented 3 years ago

Hi,

Thank you so much for sharing the code of this work!

I've encountered a problem when running the file "federated_align". I think the problem is related to the backpropagation with retain_graph=True of the adversarial loss in lines 312-316.

Traceback (most recent call last): in lossG.backward(retain_graph=True) File "/home/amelia/anaconda3/envs/py36pytorch1/lib/python3.6/site-packages/torch/tensor.py", line 221, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/amelia/anaconda3/envs/py36pytorch1/lib/python3.6/site-packages/torch/autograd/init.py", line 132, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [4, 1]], which is output 0 of TBackward, is at version 2; expected version 1 instead.

Any ideas about why this is happening and how could I fix it? Thanks again!

xiaoeyuztj commented 2 years ago

I met the same question today. There has two ways to solve the problem:

  1. remove the bn in the MLP model.
  2. change the pytorch version to 1.1.0
zyz0000 commented 1 year ago

I met the same question today. There has two ways to solve the problem:

  1. remove the bn in the MLP model.
  2. change the pytorch version to 1.1.0

Hello! Have you successfully run the code? I notice that in Line 39-48 of file federated_MoE.py, h5 files such as ./idx/NYU_sub_overlap.h5, ./idx/NYU_sub.h5, etc. , may be missing, and I cannot get how to generate them in the code. Could you please provide these files? Thank you so much and hope to your reply!

yueluoshenheng commented 1 year ago

I met the same question today. There has two ways to solve the problem:

  1. remove the bn in the MLP model.
  2. change the pytorch version to 1.1.0

Hello! Have you successfully run the code? I notice that in Line 39-48 of file federated_MoE.py, h5 files such as ./idx/NYU_sub_overlap.h5, ./idx/NYU_sub.h5, etc. , may be missing, and I cannot get how to generate them in the code. Could you please provide these files? Thank you so much and hope to your reply!

I don't have those files here either. May I ask if you have it?Thank you so much and hope to your reply!

ameliajimenez commented 1 year ago

I created a modified working version in this repository: ameliajimenez/curriculum-federated-learning, hope it's useful for you! :)

zyz0000 commented 1 year ago

Thank you for your good work! It is of great help for me!

------------------ 原始邮件 ------------------ 发件人: "xxlya/Fed_ABIDE" @.>; 发送时间: 2023年4月24日(星期一) 晚上10:31 @.>; @.**@.>; 主题: Re: [xxlya/Fed_ABIDE] Error in backpropagation for federated_align (#2)

I created a modified working version in this repository: ameliajimenez/curriculum-federated-learning, hope it's useful for you! :)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>