Git Product home page Git Product logo

Comments (12)

DesmonDay avatar DesmonDay commented on June 14, 2024

有没有什么简单的复现例子,我这边复现一下。看起来是你输入的tensor维度过多了。

from paddle.

famersalltheday avatar famersalltheday commented on June 14, 2024

https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.9/contrib/RSSegBenchmark/c2fnet/README.md
我完全复现的PaddleSeg的案例,数据集和环境都是一致的。
我这个bug也有很多人遇到过,但是不知道从何处解决。

from paddle.

DesmonDay avatar DesmonDay commented on June 14, 2024

建议从代码里面深入看为什么会出现这个问题吧

from paddle.

Bobholamovic avatar Bobholamovic commented on June 14, 2024

你好,请提供更完整的报错信息,以帮助我们排查问题~

from paddle.

famersalltheday avatar famersalltheday commented on June 14, 2024

你好,请提供更完整的报错信息,以帮助我们排查问题~

你好,
这个就是完整的报错信息。

'''NotImplementedError: (Unimplemented) Invalid dimension to be accessed. Now only supports access to dimension 0 to 9, but received dimension is 10. (at C:\home\workspace\Paddle_release\paddle/phi/core/ddim.h:53)
[operator < split > error]'''

我严格按照官方配置和环境运行的,
https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.9/contrib/RSSegBenchmark/c2fnet/README.md

from paddle.

Bobholamovic avatar Bobholamovic commented on June 14, 2024

这看起来只是错误信息的最后一段,请提供包括Python栈回溯信息在内的完整错误信息~

from paddle.

famersalltheday avatar famersalltheday commented on June 14, 2024

这看起来只是错误信息的最后一段,请提供包括Python栈回溯信息在内的完整错误信息~

Traceback (most recent call last):
File "train.py", line 269, in
main(args)
File "train.py", line 264, in main
to_static_training=cfg.to_static_training)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\train.py", line 309, in train
**test_config)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\val.py", line 169, in evaluate
crop_size=crop_size)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\infer.py", line 190, in fined_inference
logits = model(im, heatmap)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\fluid\dygraph\layers.py", line 930, in call
return self._dygraph_call_func(*inputs, **kwargs)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\fluid\dygraph\layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\models\c2fnet.py", line 261, in forward
axis=1)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\tensor\manipulation.py", line 955, in split
input=x, num_or_sections=num_or_sections, dim=axis, name=name)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\fluid\layers\nn.py", line 5097, in split
_C_ops.split(input, out, *attrs)
NotImplementedError: (Unimplemented) Invalid dimension to be accessed. Now only supports access to dimension 0 to 9, but received dimension is 10. (at C:\home\workspace\Paddle_release\paddle/phi/core/ddim.h:53)
[operator < split > error]

你好,上述是全面的报错信息。

from paddle.

Bobholamovic avatar Bobholamovic commented on June 14, 2024

RSSegBenchmark通过测试的最新版本是PaddlePaddle 2.4+PaddleSeg 2.8,而从报错信息来看,实际使用的代码应该是PaddleSeg-develop,开发分支的代码尚未经过测试,因此可能存在bug。建议在装有PaddlePaddle 2.4+PaddleSeg 2.8的环境中再次尝试~

from paddle.

famersalltheday avatar famersalltheday commented on June 14, 2024

你好,我尝试了替换环境为paddlepaddle==2.4.0 PaddleSeg==2.8.0, 依然报告相同的错误,:
Traceback (most recent call last):
File "train.py", line 269, in
main(args)
File "train.py", line 264, in main
to_static_training=cfg.to_static_training)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\train.py", line 309, in train
**test_config)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\val.py", line 169, in evaluate
crop_size=crop_size)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\core\infer.py", line 190, in fined_inference
logits = model(im, heatmap)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\fluid\dygraph\layers.py", line 948, in call
return self.forward(*inputs, **kwargs)
File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\models\c2fnet.py", line 261, in forward
axis=1)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\tensor\manipulation.py", line 1982, in split
return _C_ops.split(input, num_or_sections, dim)
NotImplementedError: (Unimplemented) Invalid dimension to be accessed. Now only supports access to dimension 0 to 9, but received dimension is 10. (at C:\home\workspace\Paddle\paddle/phi/core/ddim.h:53)

from paddle.

Bobholamovic avatar Bobholamovic commented on June 14, 2024

看起来代码并没有被更换到PaddleSeg 2.8.0。

实际上,PaddleSeg 2.8.0的contrib\RSSegBenchmark\c2fnet\models\c2fnet.py的第261行是这样的:

https://github.com/PaddlePaddle/PaddleSeg/blob/a485168da281e942af7d1643aa726d44df8c9951/contrib/RSSegBenchmark/c2fnet/models/c2fnet.py#L261

而PaddleSeg-develop的对应行是这样的:

https://github.com/PaddlePaddle/PaddleSeg/blob/7c07b1d49aeeb10b6d6f0aa244aab4171ab2709c/contrib/RSSegBenchmark/c2fnet/models/c2fnet.py#L261

使用PaddleSeg develop的代码才可能得到这样的错误信息:

File "E:\PaddleSeg-develop\contrib\RSSegBenchmark\c2fnet\models\c2fnet.py", line 261, in forward
axis=1)

因此,你使用的很可能还是PaddleSeg develop的代码。请更换PaddleSeg 2.8后尝试~

请注意,你应该从GitHub或Gitee等代码托管网站下载PaddleSeg 2.8的完整代码,使用其中的contrib\RSSegBenchmark子项目,而不只是通过pip等工具安装paddleseg库~

from paddle.

famersalltheday avatar famersalltheday commented on June 14, 2024

File "E:\Segmentation\PaddleSeg-release-2.8\contrib\RSSegBenchmark\c2fnet\core\train.py", line 309, in train
**test_config)
File "E:\Segmentation\PaddleSeg-release-2.8\contrib\RSSegBenchmark\c2fnet\core\val.py", line 169, in evaluate
crop_size=crop_size)
File "E:\Segmentation\PaddleSeg-release-2.8\contrib\RSSegBenchmark\c2fnet\core\infer.py", line 190, in fined_inference
logits = model(im, heatmap)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\fluid\dygraph\layers.py", line 948, in call
return self.forward(*inputs, **kwargs)
File "E:\Segmentation\PaddleSeg-release-2.8\contrib\RSSegBenchmark\c2fnet\models\c2fnet.py", line 270, in forward
axis=1)
File "D:\anaconda3\envs\segmentation\lib\site-packages\paddle\tensor\manipulation.py", line 1982, in split
return _C_ops.split(input, num_or_sections, dim)
NotImplementedError: (Unimplemented) Invalid dimension to be accessed. Now only supports access to dimension 0 to 9, but received dimension is 10. (at C:\home\workspace\Paddle\paddle/phi/core/ddim.h:53)

你好,我已经按照您的指示,重新下载了PaddleSeg 2.8,不是pip安装的。
测试报错如下,报错内容一样,只是错误信息所在的行数发生了变化

我想补充强调的是代码可以训练,但是在保存权重的时候 报错这个问题

from paddle.

Bobholamovic avatar Bobholamovic commented on June 14, 2024

我想补充强调的是代码可以训练,但是在保存权重的时候 报错这个问题

我读了一下代码,这个分支是推理阶段(self.training为False)才执行的,所以这一现象是符合预期的。

关于这个错误,我实验发现有可能在num_or_sections列表元素之和与输入tensor在指定axis的尺寸不一致时触发,对于我们的情况而言,也就是说selected_fea_regions的第1维尺寸可能不是16(结合上下文来看,也就是说,设置的类别数可能不是16)。建议在E:\Segmentation\PaddleSeg-release-2.8\contrib\RSSegBenchmark\c2fnet\models\c2fnet.py的第267行执行print(selected_fea_regions.shape)检查tensor的尺寸是否符合预期。

from paddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.