在定义数据增强时出现以下错误
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都升到了最高级,不知道怎么解决。
看这个信息,只看到了一堆警告,没有看到报错呀。
代码应该能用吧。。。都是最新版本的话,应该没问题了
我用这个数据增强去训练模型时,会发现显存和GPU的使用量都为0,无法训练
target_sizes 这么长吗?建议检查下数据的shape。transforms要求的格式为HWC,输入numpy格式数据
是报错了吗?是不是显存爆了?看上面的信息分析不出来呀。。。
没有报错,就很迷,程序一直在运行,但就是显存和GPU使用量为0,训练不了。
你去终端运行nvidia-smi。底下的可视化显示有bug
可能是数据集出了问题,数据集的返回值需要np.float32。
当BML中出现这个问题时,程序会一直运行且不报错。
显示没有程序在跑,但我在main中已经显示在跑了
不会cpu再跑把。你看看cpu占用率
上次我在30系电脑上运行也出现类似问题,短时间不报错,等了很久
后来更新了cuda到11+就好了。。。。
再就是建议你把arget_sizes改成只有一个试试,说不定问题就解决了
会不会显卡没有认到
你好,这个应该怎么设置呢
在dataset返回的数据加上astype(np.float32),就是把数据转成np.float32格式