-
Notifications
You must be signed in to change notification settings - Fork 7
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
ValueError: too many values to unpack (expected 3) #1
Comments
代码已修正
------------------ Original ------------------
From: ***@***.***>;
Date: Thu, Mar 9, 2023 07:17 PM
To: ***@***.***>;
Cc: ***@***.***>;
Subject: [ZhengJianwei2/DMINet] ValueError: too many values to unpack (expected 3) (Issue #1)
在运行main_cd.py与eval_cd.py出现如下错误,不知道如何修改,求助。
self.G_pred1, self.G_pred2, self.G_pred3 = self.net_G(img_in1, img_in2)
ValueError: too many values to unpack (expected 3)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
我也遇到了这个问题,请问一下是如何修改的呢? |
抱歉,我也不知道,作者说已经修改了,但是我运行仍存在错误,请问你现在解决了吗? |
之前登错了账号,发现没修改成功,现已修改,感谢持续关注! |
十分感谢您的回复和帮助,问题已经解决! |
之前Github上DMINet的代码train.py中优化器放的是Adam,但在实际训练中我们使用的SGD,现已修正,十分抱歉,如果有跑代码,劳烦注意一下,性能可能有点差别。 |
感谢您的提醒! |
您好,我还有个问题想向您确认一下,您论文中的指标(以F1为例),是指的模型训练结果中的F1_1,而不是mf1,是吗? |
是的,F1_1是专指变化区域的F1-Score |
self.G_loss = self._pxl_loss(self.G_pred1, gt) + self._pxl_loss(self.G_pred2, gt) + 0.5*(self._pxl_loss(self.self.G_middle1, gt)+self._pxl_loss(self.self.G_middle2, gt)) |
正解如下,里面多打了两个self
self.G_loss = self._pxl_loss(self.G_pred1, gt) + self._pxl_loss(self.G_pred2, gt) + 0.5*(self._pxl_loss(self.G_middle1, gt)+self._pxl_loss(self.G_middle2, gt))
1149160349
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2023年4月6日(星期四) 晚上9:45
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ZhengJianwei2/DMINet] ValueError: too many values to unpack (expected 3) (Issue #1)
self.G_loss = self._pxl_loss(self.G_pred1, gt) + self._pxl_loss(self.G_pred2, gt) + 0.5*(self._pxl_loss(self.self.G_middle1, gt)+self._pxl_loss(self.self.G_middle2, gt))
AttributeError: 'CDTrainer' object has no attribute 'self'
训练时总会出现这个错误,但是一旦删掉一个额外的self,使用demo.py生成特征图是则又会报错,请问该如何解决
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
求问:在运行main_cd.py时,遇到如下错误,请问如何修改呢 |
请问,在运行demo.py时遇到这个问题该如何解决: |
'--net_G' 选择 DMINet, github代码已修改
1149160349
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2023年4月7日(星期五) 下午2:58
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ZhengJianwei2/DMINet] ValueError: too many values to unpack (expected 3) (Issue #1)
请问,在运行demo.py时遇到这个问题该如何解决:
Traceback (most recent call last):
File "/home/B/hyf/DMI/demo.py", line 70, in
score_map = model._forward_pass(batch)
File "/home/B/hyf/DMI/models/basic_model.py", line 64, in _forward_pass
return self._visualize_pred()
File "/home/B/hyf/DMI/models/basic_model.py", line 52, in _visualize_pred
pred = torch.argmax(self.G_pred, dim=1, keepdim=True)
TypeError: argmax(): argument 'input' (position 1) must be Tensor, not tuple
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
你好,这个错误我没遇到过,报错位置在哪个文件夹呀
1149160349
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2023年4月7日(星期五) 下午2:36
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ZhengJianwei2/DMINet] ValueError: too many values to unpack (expected 3) (Issue #1)
求问:在运行main_cd.py时,遇到如下错误,请问如何修改呢
hist = np.bincount(num_classes * label_gt[mask].astype(int) + label_pred[mask],
IndexError: boolean index did not match indexed array along dimension 0; dimension is 65536 but corresponding boolean dimension is 196608
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
您好,这是完整的报错信息: 在metric_tool的报错位置打印看了一下,形参label_gt.size和label_pred.size的shape都为(65536,) Begin evaluation... |
|
您好,能提供一下论文中热力图的可视化代码吗,自己从网上找的一直没有调好。 |
在运行main_cd.py与eval_cd.py出现如下错误,不知道如何修改,求助。
self.G_pred1, self.G_pred2, self.G_pred3 = self.net_G(img_in1, img_in2)
ValueError: too many values to unpack (expected 3)
The text was updated successfully, but these errors were encountered: