Closed MindaWu closed 3 years ago
在vilbert那个链接最下面的表格上有下载链接,VCR那一栏就是,https://www.dropbox.com/sh/9pgxc3njd3iq03o/AADXgnT1HmEdrds7aujTncBGa?dl=0
我将 vilbert 的文件名修改为 VCR_resnet101_faster_rcnn_genome_pickle2.lmdb
后,报错信息变成了
Traceback (most recent call last):
File "finetune.py", line 464, in <module>
main(args)
File "finetune.py", line 371, in main
epoch=args.epoch,)
File "/home/wmd/workspace/ERNIE-repro/ernie-vil/reader/vcr_finetuning.py", line 424, in __init__
ImageFeaturesH5Reader(task_conf['feature_lmdb_path'])
File "/home/wmd/workspace/ERNIE-repro/ernie-vil/reader/_image_features_reader.py", line 30, in __init__
self._image_ids = pickle.loads(txn.get('keys'.encode()))
File "/home/wmd/anaconda3/envs/paddle_env/lib/python2.7/pickle.py", line 1388, in loads
return Unpickler(file).load()
File "/home/wmd/anaconda3/envs/paddle_env/lib/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/home/wmd/anaconda3/envs/paddle_env/lib/python2.7/pickle.py", line 892, in load_proto
raise ValueError, "unsupported pickle protocol: %d" % proto
ValueError: unsupported pickle protocol: 3
请问是还需要对数据进行一些别的操作吗?
python2 和 python3的pickle读取方式不一样,将pickle的读取方式更换一下,或者提取对数据进行一下转换就可以了
将 _image_features_reader.py
中的pickle
全部替换为cPickle
后,仍然报错,报错信息如下:
Traceback (most recent call last):
File "finetune.py", line 464, in <module>
main(args)
File "finetune.py", line 371, in main
epoch=args.epoch,)
File "/home/wmd/workspace/ERNIE-repro/ernie-vil/reader/vcr_finetuning.py", line 424, in __init__
ImageFeaturesH5Reader(task_conf['feature_lmdb_path'])
File "/home/wmd/workspace/ERNIE-repro/ernie-vil/reader/_image_features_reader.py", line 33, in __init__
self._image_ids = cPickle.loads(txn.get('keys'.encode()))
ValueError: unsupported pickle protocol: 3
解决方法是用pickcle3打开这个lmdb文件,然后用pickcle2的方式存储(把原来的cpickcle改回去),核心代码pickle.dumps(pickle.loads(value), protocol=2),详情参见https://stackoverflow.com/questions/25843698/valueerror-unsupported-pickle-protocol-3-python2-pickle-can-not-load-the-file
请问大佬有下载好的vil-bert里VCR视觉特征文件吗 .mdb 58GB那个。VPN太不稳定了下载好多次一直失败。不胜感激!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen it. Thank you for your contributions.
使用 ERNIE-ViL base 在 vcr 数据集上进行 finetune 时,出现以下错误:
文档里说明数据使用的是 vilbert 的数据,但是在 vilbert 提供的下载链接里并没有
VCR_resnet101_faster_rcnn_genome_pickle2.lmdb
,只有VCR_gt_resnet101_faster_rcnn_genome.lmdb
。 请问VCR_resnet101_faster_rcnn_genome_pickle2.lmdb
该如何获取?