eric612 / MobileNet-YOLO

A caffe implementation of MobileNet-YOLO detection network
Other
865 stars 442 forks source link

question about add parameter yolo_data_type in batch_sampler? #278

Open 18242360613 opened 3 years ago

18242360613 commented 3 years ago

I'm trying to use pycaffe to write model structures and generate prototxt files. However, when defining the batchsampler in the annotateddata data layer, it prompts "attributeerror: Yolo" data type”。

batch_sampler定义如下。 batch_sampler = [ {'yolo_data_type':1}, { 'sampler': { }, 'max_trials': 1, 'max_sample': 1, }, .... ]

key code

net = caffe.NetSpec() net.data, net.label = CreateAnnotatedDataLayer(data_path, batch_size=8, train=True, output_label=True, label_map_file=label_map_file, transform_param=train_transform_param, batch_sampler=batch_sampler) print(net.to_proto())

errors

Traceback (most recent call last): File "/workspace/yolo_caffe_nnie/data_para.py", line 319, in print(net.to_proto()) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 213, in to_proto top._to_proto(layers, names, autonames) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 100, in _to_proto return self.fn._to_proto(layers, names, autonames) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 162, in _to_proto assign_proto(layer, k, v) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 77, in assign_proto assign_proto(getattr(proto, name), k, v) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 72, in assign_proto assign_proto(proto_item, k, v) File "/workspace/MobileNet-YOLO/python/caffe/net_spec.py", line 64, in assign_proto is_repeated_field = hasattr(getattr(proto, name), 'extend') AttributeError: yolo_data_type