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

在emanet插入一个AFF后,训练正常,评估报错 #3454

Open
3 tasks done
loxoo6 opened this issue Aug 15, 2023 · 1 comment
Open
3 tasks done

在emanet插入一个AFF后,训练正常,评估报错 #3454

loxoo6 opened this issue Aug 15, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@loxoo6
Copy link

loxoo6 commented Aug 15, 2023

问题确认 Search before asking

Bug描述 Describe the Bug

2023-08-15 17:11:46 [INFO] [TRAIN] epoch: 12, iter: 500/20000, loss: 0.3383, lr: 0.008798, batch_cost: 1.2200, reader_cost: 0.88773, ips: 3.2786 samples/sec | ETA 06:36:30
2023-08-15 17:11:46 [INFO] Start evaluating (total_samples: 60, total_iters: 60)...
Traceback (most recent call last):
File "/home/aistudio/PaddleSeg/tools/train.py", line 262, in
main(args)
File "/home/aistudio/PaddleSeg/tools/train.py", line 238, in main
train(
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleseg/core/train.py", line 283, in train
mean_iou, acc, _, _, _ = evaluate(
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleseg/core/val.py", line 161, in evaluate
intersect_area, pred_area, label_area = metrics.calculate_area(
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleseg/utils/metrics.py", line 57, in calculate_area
pred_area = paddle.concat(pred_area)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/tensor/manipulation.py", line 1121, in concat
return _C_ops.concat(input, axis)
ValueError: (InvalidArgument) The axis is expected to be in range of [0, 0), but got 0
[Hint: Expected axis >= -rank && axis < rank == true, but received axis >= -rank && axis < rank:0 != true:1.] (at ../paddle/phi/infermeta/multiary.cc:961)


C++ Traceback (most recent call last):

No stack trace in paddle, may be caused by external reasons.


Error Message Summary:

FatalError: Process abort signal is detected by the operating system.
[TimeInfo: *** Aborted at 1692090709 (unix time) try "date -d @1692090709" if you are using GNU date ***]
[SignalInfo: *** SIGABRT (@0x3e800000665) received by PID 1637 (TID 0x7fe71a2a0700) from PID 1637 ***]

AFF代码:
import paddle
import paddle.nn as nn

class AFF(nn.Layer):
'''
多特征融合 AFF
'''

def __init__(self, channels=64, r=4):
    super(AFF, self).__init__()
    inter_channels = int(channels // r)

    self.local_att = nn.Sequential(
        nn.Conv2D(channels, inter_channels, kernel_size=1, stride=1, padding=0),
        nn.SyncBatchNorm(inter_channels),
        nn.ReLU(),
        nn.Conv2D(inter_channels, channels, kernel_size=1, stride=1, padding=0),
        nn.SyncBatchNorm(channels),
    )

    self.global_att = nn.Sequential(
        nn.AdaptiveAvgPool2D(1),
        nn.Conv2D(channels, inter_channels, kernel_size=1, stride=1, padding=0),
        nn.SyncBatchNorm(inter_channels),
        nn.ReLU(),
        nn.Conv2D(inter_channels, channels, kernel_size=1, stride=1, padding=0),
        nn.SyncBatchNorm(channels),
    )

    self.sigmoid = nn.Sigmoid()

def forward(self, x, residual):
    xa = x + residual
    xl = self.local_att(xa)
    xg = self.global_att(xa)
    xlg = xl + xg
    wei = self.sigmoid(xlg)

    x = 2 * x * wei + 2 * residual * (1 - wei)
    return x

复现环境 Environment

paddlepaddle:2.5.0
paddleseg:2.7.0
aistudio上面运行的

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@loxoo6 loxoo6 added the bug Something isn't working label Aug 15, 2023
@Asthestarsfalll
Copy link
Contributor

是计算metric时出现的问题,请使用从源码安装的方式安装2.8或者develop试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants