Reproduce the problem encountered by the ssd

The first is to modify the path of data_dir in create_list.sh and create_data.sh.

Then there is the error generated when the create_data.sh file calls create_annoset.py in the scripts directory under $caffe_root:

Traceback (most recent call last):
File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/create_annoset.py", line 105, in <module>
label_map = caffe_pb2.LabelMap()
AttributeError: 'module' object has no attribute 'LabelMap'
Traceback (most recent call last):
File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/create_annoset.py", line 105, in <module>
label_map = caffe_pb2.LabelMap()
AttributeError: 'module' object has no attribute 'LabelMap'

The reason should be that the PYTHONPATH path is not added.

Reference URL: https://github.com/manutdzou/KITTI_SSD/issues/5

Refer to this URL to join PYTHONPATH: https://blog.csdn.net/jasonzzj/article/details/53941147

Here I choose to add PYTHONPATH to the ~/.bashrc file. Since there are other directories in my computer that contain caffe projects, next time I use other caffe directories, I may need to modify the path of PYTHONPATH.

The next step is normal processing. The log is as follows

/opt/xuben-project/caffe/build/tools/convert_annoset --anno_type=detection --label_type=xml --label_map_file=/opt/xuben-project/caffe/data/VOC0712/../../data/VOC0712/labelmap_voc.prototxt --check_label=True --min_dim=0 --max_dim=0 --resize_height=0 --resize_width=0 --backend=lmdb --shuffle=False --check_size=False --encode_type=jpg --encoded=True --gray=False /opt/xuben-data/VOCdevkit/ /opt/xuben-project/caffe/data/VOC0712/../../data/VOC0712/test.txt /opt/xuben-data/VOCdevkit/VOC0712/lmdb/VOC0712_test_lmdb
I0422 17:20:58.777124 25860 convert_annoset.cpp:122] A total of 4952 images.
I0422 17:20:58.777395 25860 db_lmdb.cpp:35] Opened lmdb /opt/xuben-data/VOCdevkit/VOC0712/lmdb/VOC0712_test_lmdb
I0422 17:21:03.382318 25860 convert_annoset.cpp:195] Processed 1000 files.
I0422 17:21:07.988387 25860 convert_annoset.cpp:195] Processed 2000 files.
I0422 17:21:12.813705 25860 convert_annoset.cpp:195] Processed 3000 files.
I0422 17:21:17.298377 25860 convert_annoset.cpp:195] Processed 4000 files.
I0422 17:21:22.664110 25860 convert_annoset.cpp:201] Processed 4952 files.
link_dir:examples/VOC0712/VOC0712_test_lmdb
/opt/xuben-project/caffe/build/tools/convert_annoset --anno_type=detection --label_type=xml --label_map_file=/opt/xuben-project/caffe/data/VOC0712/../../data/VOC0712/labelmap_voc.prototxt --check_label=True --min_dim=0 --max_dim=0 --resize_height=0 --resize_width=0 --backend=lmdb --shuffle=False --check_size=False --encode_type=jpg --encoded=True --gray=False /opt/xuben-data/VOCdevkit/ /opt/xuben-project/caffe/data/VOC0712/../../data/VOC0712/trainval.txt /opt/xuben-data/VOCdevkit/VOC0712/lmdb/VOC0712_trainval_lmdb
I0422 17:21:23.231978 25883 convert_annoset.cpp:122] A total of 16551 images.
I0422 17:21:23.232414 25883 db_lmdb.cpp:35] Opened lmdb /opt/xuben-data/VOCdevkit/VOC0712/lmdb/VOC0712_trainval_lmdb
I0422 17:21:58.782371 25883 convert_annoset.cpp:195] Processed 1000 files.
I0422 17:22:39.531497 25883 convert_annoset.cpp:195] Processed 2000 files.
I0422 17:23:21.844856 25883 convert_annoset.cpp:195] Processed 3000 files.
I0422 17:24:00.439805 25883 convert_annoset.cpp:195] Processed 4000 files.
I0422 17:24:36.319861 25883 convert_annoset.cpp:195] Processed 5000 files.
I0422 17:25:12.599020 25883 convert_annoset.cpp:195] Processed 6000 files.
I0422 17:25:52.925842 25883 convert_annoset.cpp:195] Processed 7000 files.
I0422 17:26:35.024026 25883 convert_annoset.cpp:195] Processed 8000 files.
I0422 17:27:20.739751 25883 convert_annoset.cpp:195] Processed 9000 files.
I0422 17:28:06.118722 25883 convert_annoset.cpp:195] Processed 10000 files.
I0422 17:28:45.578575 25883 convert_annoset.cpp:195] Processed 11000 files.
I0422 17:29:17.399873 25883 convert_annoset.cpp:195] Processed 12000 files.

I0422 17:29:56.108283 25883 convert_annoset.cpp:195] Processed 13000 files.
I0422 17:30:34.113029 25883 convert_annoset.cpp:195] Processed 14000 files.
I0422 17:31:14.184615 25883 convert_annoset.cpp:195] Processed 15000 files.
I0422 17:31:54.871651 25883 convert_annoset.cpp:195] Processed 16000 files.
I0422 17:32:17.246522 25883 convert_annoset.cpp:201] Processed 16551 files.
link_dir:examples/VOC0712/VOC0712_trainval_lmdb

This is successfully completed.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324654104&siteId=291194637