Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

自制图片分类数据集,提示错误ValueError: insecure string pickle

Open Ihuzb opened this issue 9 years ago • 6 comments

自己做的图片分类数据集,运行时报错: Traceback (most recent call last): File "/home/showme/python/two.py", line 97, in feeding=feeding) File "/usr/local/lib/python2.7/dist-packages/paddle/v2/trainer.py", line 146, in train for batch_id, data_batch in enumerate(reader()): File "/usr/local/lib/python2.7/dist-packages/paddle/v2/minibatch.py", line 33, in batch_reader for instance in r: File "/usr/local/lib/python2.7/dist-packages/paddle/v2/reader/decorator.py", line 67, in data_reader for e in reader(): File "/usr/local/lib/python2.7/dist-packages/paddle/v2/dataset/cifar.py", line 60, in reader batch = cPickle.load(f.extractfile(name)) ValueError: insecure string pickle

Ihuzb avatar Nov 08 '17 08:11 Ihuzb

Thought this is a pure python question, you can do some search about python insecure string pickle

May came out with something like: https://stackoverflow.com/questions/1746825/python-valueerror-insecure-string-pickle

typhoonzero avatar Nov 08 '17 09:11 typhoonzero

自制数据集的话,百度有官方的代码嘛?

Ihuzb avatar Nov 08 '17 09:11 Ihuzb

自制数据集的话,百度有官方的代码嘛?

没太理解这句话的意思。“自制数据集”的数据格式必然不是一成不变的,需要对应的reader实现数据feed。如果需要参考针对特定数据集reader的实现方法,可以参考:

  • https://github.com/PaddlePaddle/book
  • https://github.com/PaddlePaddle/models

下面的例子

typhoonzero avatar Nov 08 '17 09:11 typhoonzero

{'batch_label': 'testing batch 1 of 1', 'labels': [0, 0], 'data': array([[144, 143, 151, ..., 187, 187, 185], [104, 106, 92, ..., 111, 99, 120]], dtype=uint8), 'filenames': ['0_10003.jpg', '0_10004.jpg']} 这是我按照网上的demo做的自定义数据集,可是每次放到图像分类种运行这个经常提示各种问题。在制作自定义数据集的时候您有标准代码来制作数据集嘛?

Ihuzb avatar Nov 08 '17 09:11 Ihuzb

您好,您自制数据集有例子吗?

466821202 avatar Nov 14 '17 06:11 466821202

不用制作的,可以使用有一个列表就可以了,文档:https://github.com/PaddlePaddle/models/tree/develop/image_classification#定义数据读取

yeyupiaoling avatar Jan 14 '18 09:01 yeyupiaoling