首页 PaddleX 帖子详情
Paddlex定义数据增强时的问题
收藏
快速回复
PaddleX 问答解决方案全流程 3044 14
Paddlex定义数据增强时的问题
收藏
快速回复
PaddleX 问答解决方案全流程 3044 14

在定义数据增强时出现以下错误

from paddlex import transforms
train_transforms = transforms.Compose([
    transforms.MixupImage(mixup_epoch=180),
    transforms.RandomDistort(hue_prob=0),
    transforms.RandomExpand(),
    transforms.RandomHorizontalFlip(),
    transforms.RandomResize(target_sizes=[320, 352, 384, 416, 448, 480, 512, 544, 576, 608],interp='RANDOM'), 
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    
])

eval_transforms = transforms.Compose([
    transforms.Resize(target_size=608, interp='CUBIC'),
    transforms.Normalize(),
])

 

[12-26 23:25:09 MainThread @utils.py:79] WRN paddlepaddle version: 2.2.1. The dynamic graph version of PARL is under development, not fully tested and supported

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/remote/communication.py:38: DeprecationWarning: 'pyarrow.default_serialization_context' is deprecated as of 2.0.0 and will be removed in a future version. Use pickle or the pyarrow IPC functionality instead.
context = pyarrow.default_serialization_context()
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pyarrow/pandas_compat.py:1027: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
'floating': np.float,
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/__init__.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import MutableMapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/rcsetup.py:20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable, Mapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/colors.py:53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Sized
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/creation.py:130: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
if data.dtype == np.object:

 

应该是版本问题,其中paddlex和paddlepaddle都升到了最高级,不知道怎么解决。

0
收藏
回复
全部评论(14)
时间顺序
DeepGeGe
#2 回复于2021-12

看这个信息,只看到了一堆警告,没有看到报错呀。

0
回复
李长安
#3 回复于2021-12

代码应该能用吧。。。都是最新版本的话,应该没问题了

0
回复
lzzzzzm
#4 回复于2021-12
代码应该能用吧。。。都是最新版本的话,应该没问题了

我用这个数据增强去训练模型时,会发现显存和GPU的使用量都为0,无法训练

0
回复
十进制到二进制
#5 回复于2021-12

target_sizes 这么长吗?建议检查下数据的shape。transforms要求的格式为HWC,输入numpy格式数据

0
回复
李长安
#6 回复于2021-12
lzzzzzm #4
我用这个数据增强去训练模型时,会发现显存和GPU的使用量都为0,无法训练

是报错了吗?是不是显存爆了?看上面的信息分析不出来呀。。。

0
回复
lzzzzzm
#7 回复于2021-12
是报错了吗?是不是显存爆了?看上面的信息分析不出来呀。。。

没有报错,就很迷,程序一直在运行,但就是显存和GPU使用量为0,训练不了。

0
回复
Y_kira
#8 回复于2021-12
lzzzzzm #7
没有报错,就很迷,程序一直在运行,但就是显存和GPU使用量为0,训练不了。

你去终端运行nvidia-smi。底下的可视化显示有bug

0
回复
时间女神
#9 回复于2021-12

可能是数据集出了问题,数据集的返回值需要np.float32。

当BML中出现这个问题时,程序会一直运行且不报错。

0
回复
lzzzzzm
#10 回复于2022-01
Y_kira #8
你去终端运行nvidia-smi。底下的可视化显示有bug

显示没有程序在跑,但我在main中已经显示在跑了

0
回复
Y_kira
#11 回复于2022-01
lzzzzzm #10
显示没有程序在跑,但我在main中已经显示在跑了 [图片][图片]

不会cpu再跑把。你看看cpu占用率

0
回复
奔向未来的样子
#12 回复于2022-01

上次我在30系电脑上运行也出现类似问题,短时间不报错,等了很久

后来更新了cuda到11+就好了。。。。

再就是建议你把arget_sizes改成只有一个试试,说不定问题就解决了

0
回复
哈哈哈哈_837
#13 回复于2022-02

会不会显卡没有认到

0
回复
h
hy_shadow
#16 回复于2022-05
可能是数据集出了问题,数据集的返回值需要np.float32。 当BML中出现这个问题时,程序会一直运行且不报错。

你好,这个应该怎么设置呢

0
回复
时间女神
#17 回复于2022-06
hy_shadow #16
你好,这个应该怎么设置呢

在dataset返回的数据加上astype(np.float32),就是把数据转成np.float32格式

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户