1)PaddlePaddle版本:2.2
2)CPU:AMD3500U
3)GPU:无
4)系统环境:windows10, Python版本3.7
WARNING: Detect dataset only contains single fileds, return format changed since Paddle 2.1. In Paddle <= 2.0, DataLoader add a list surround output data(e.g. return [data]), and in Paddle >= 2.1, DataLoader return the single filed directly (e.g. return data).
paddle已经是2.2版本的, 但是__getitem__返回数据不加 [] 就会WARNING
啥时候修复错误
快速复现该WARNING:
import numpy as np
import paddle
from paddle.io import DataLoader
# define a random dataset
class Dataset(paddle.io.Dataset):
def __init__(self, images):
self.images = images[:]
def __getitem__(self, index):
return self.images[index].astype('float32')
# return [self.images[index].astype('float32')]
def __len__(self):
return len(self.images)
images = paddle.rand((100,224,224))
i_query_data = Dataset( images)
loader = DataLoader(i_query_data,
batch_size=64,
shuffle=True,
drop_last=True,
num_workers=0)
for i,image in enumerate(loader()):
print(i,image)
break
4条答案
按热度按时间ippsafx71#
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
klsxnrf12#
您好,这是个不兼容升级的warning,代码运行没有问题的话不用关注的。
gg0vcinb3#
您好,这是个不兼容升级的warning,代码运行没有问题的话不用关注的。
问题在于,每跑一轮模型我就调用手写的模型测试时,WARNING就输出一次,还得手动设置忽略。并且我的做法在in Paddle >= 2.1, DataLoader return the single filed directly 下,按提示说就不应该出现WARNING的。要么你们可以改一下提示 In Paddle >= 2.1, DataLoader add a list surround output data(e.g. return [data])得了,返回data加 []反而没提示WARNING
0aydgbwb4#
您的建议已收到,并反馈给相关开发同学,内部会评估如何优化该输出信息,感谢您的建议。