- Download ncs graph model: https://pan.baidu.com/s/1WI_r6jazYikrcq2E6qklrQ key:4vs5
- run count_for_video_ncs.py with python2
Detail instruction: https://github.com/ahangchen/windy-afternoon/blob/master/linux/raspbian/ncs_detection.md
Raspberry Pi NCS Object detection,端上CNN实践
Detail instruction: https://github.com/ahangchen/windy-afternoon/blob/master/linux/raspbian/ncs_detection.md
When i test my graph with my jpg file,it's output "google.protobuf.message.DecodeError: Tag had invalid wire type."
maybe my train step has mistake.how to tackle the problem or which step am i wrong?
Thanks in advance.
I use labelimg to dealwith jpg file.
ImageSets file like this:
########################
markimg39.jpg markimg39.xml
markimg50.jpg markimg50.xml
markimg67.jpg markimg67.xml
timg (18).jpg timg (18).xml
timg (33).jpg timg (33).xml
timg (19).jpg timg (19).xml
#######################
假设你的打的标签是这样一个文件raw_label.txt,假装我们数据集只有两张图片:
data/strange_animal/1017.jpg 0.487500 0.320675 0.670000 0.433193
data/strange_animal/1018.jpg 0.215000 0.293952 0.617500 0.481013
labelmap_coco.prototxt like this:
######################################
item {
name: "none_of_the_above"
label: 0
display_name: "background"
}
item {
name: "markpoint"
label: 1
display_name: "markpoint"
}
###########################
item {
name: "markpoint"
label: 1
display_name: "markpoint"
}
##############################
item {
name: "/m/01g317"
id: 1
display_name: "new"
}
item {
name: "/m/0199g"
id: 2
display_name: "bicycle"
}
#########################
###########################
<annotation> <folder>train</folder> <filename>markimg2.jpg</filename> <path>H:\Tensorflow_ObjectDetection_MarkLabel\src\research\customized_model\images\pre\train\markimg2.jpg</path> <source> <database>Unknown</database> </source> <size> <width>640</width> <height>480</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>markpoint</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>133</xmin> <ymin>225</ymin> <xmax>212</xmax> <ymax>298</ymax> </bndbox> </object> <object> <name>markpoint</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>265</xmin> <ymin>133</ymin> <xmax>338</xmax> <ymax>194</ymax> </bndbox> </object> <object> <name>markpoint</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>388</xmin> <ymin>133</ymin> <xmax>465</xmax> <ymax>196</ymax> </bndbox> </object> <object> <name>markpoint</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>381</xmin> <ymin>238</ymin> <xmax>472</xmax> <ymax>326</ymax> </bndbox> </object> <object> <name>markpoint</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>252</xmin> <ymin>357</ymin> <xmax>344</xmax> <ymax>462</ymax> </bndbox> </object> </annotation>
##############################
pi@raspberrypi:/workspace/ncs_detection $ python ncs_detection_testmarkpoint.py/workspace/ncs_detection $
mkdir: cannot create directory ‘r10_tmp’: File exists
rm: cannot remove 'r10_tmp/*': No such file or directory
[INFO] finding NCS devices...
[INFO] found 1 devices. device0 will be used. opening device0...
[INFO] loading the graph file into RPi memory...
[INFO] allocating the graph on the NCS...
<mvnc.mvncapi.Graph instance at 0x6cbce260>
('data/labelmap_coco.pbtxt', 1)
Traceback (most recent call last):
File "ncs_detection_testmarkpoint.py", line 172, in
count_for_video_ncs(img_dir, start_index, end_index)
File "ncs_detection_testmarkpoint.py", line 129, in count_for_video_ncs
category_index = label_prepare(PATH_TO_LABELS, NUM_CLASSES)
File "ncs_detection_testmarkpoint.py", line 96, in label_prepare
label_map = label_map_util.load_labelmap(PATH_TO_LABELS)
File "/home/pi/workspace/ncs_detection/object_detection/utils/label_map_util.py", line 122, in load_labelmap
label_map.ParseFromString(label_map_string)
File "/usr/local/lib/python2.7/dist-packages/protobuf-3.5.1-py2.7.egg/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/usr/local/lib/python2.7/dist-packages/protobuf-3.5.1-py2.7.egg/google/protobuf/internal/python_message.py", line 1083, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/local/lib/python2.7/dist-packages/protobuf-3.5.1-py2.7.egg/google/protobuf/internal/python_message.py", line 1109, in InternalParse
new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
File "/usr/local/lib/python2.7/dist-packages/protobuf-3.5.1-py2.7.egg/google/protobuf/internal/decoder.py", line 850, in SkipField
return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, end)
File "/usr/local/lib/python2.7/dist-packages/protobuf-3.5.1-py2.7.egg/google/protobuf/internal/decoder.py", line 820, in _RaiseInvalidWireType
raise _DecodeError('Tag had invalid wire type.')
google.protobuf.message.DecodeError: Tag had invalid wire type.
pi@raspberrypi:
你好,我在运行ncs_detection.py时报错:
File "ncs_detection.py", line 64, in ncs_prepare
devices = mvnc.EnumerateDevices()
AttributeError: 'module' object has no attribute 'EnumerateDevices'
请问有什么解决办法呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.