1KK077 / IDKL

11 stars 3 forks source link

AttributeError: 'Baseline' object has no attribute 'mutual_learning' #5

Open AaronCIH opened 2 months ago

AaronCIH commented 2 months ago

Hello,

I tried to train the model, but there is a problem.

...IDKL/IDKL/engine/init.py", line 109, in epoch_started_callback if model.mutual_learning: File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1261, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Baseline' object has no attribute 'mutual_learning'

xieqiangqiang0105 commented 2 months ago

请问解决了吗

chenlong50 commented 1 month ago

我也出现这个报错,在这个报错前还出现了TypeError: init() missing 1 required positional argument: 'modality_attention',我自己修改代码解决了,但后边这个不知道怎么处理

xieqiangqiang0105 commented 1 month ago

一模一样,我在想是不是apex的问题

chenlong50 commented 1 month ago

apex加速运算的 跟这个没关系吧

xieqiangqiang0105 commented 1 month ago

一模一样,我感觉会不会是apex的问题

------------------ 原始邮件 ------------------ 发件人: "1KK077/IDKL" @.>; 发送时间: 2024年7月23日(星期二) 晚上9:18 @.>; @.**@.>; 主题: Re: [1KK077/IDKL] AttributeError: 'Baseline' object has no attribute 'mutual_learning' (Issue #5)

我也出现这个报错,在这个报错前还出现了TypeError: init() missing 1 required positional argument: 'modality_attention',我自己修改代码解决了,但后边这个不知道怎么处理

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

xieqiangqiang0105 commented 1 month ago

那是他代码本身就有问题吗?他不是说没有放完整代码吗

------------------ 原始邮件 ------------------ 发件人: "1KK077/IDKL" @.>; 发送时间: 2024年7月23日(星期二) 晚上9:57 @.>; @.**@.>; 主题: Re: [1KK077/IDKL] AttributeError: 'Baseline' object has no attribute 'mutual_learning' (Issue #5)

apex加速运算的 跟这个没关系吧

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

AaronCIH commented 1 month ago

@xieqiangqiang0105 @chenlong50 I have figured out this problem: AttributeError: 'Baseline' object has no attribute 'mutual_learning'.

Please add a line: "self.mutual_learning = kwargs.get('mutual_learning', False)" in the IDKL/IDKL/models/baseline.py Baseline.init() function.

vinvince628 commented 1 month ago

我已经弄清楚了这个问题:AttributeError:“Baseline”对象没有属性“mutual_learning”。

请在 IDKL/IDKL/models/baseline.py 基线中添加一行:“self.mutual_learning = kwargs.get('mutual_learning', False)”。init() 函数。

请问训练出来了吗