dlod-openvino / book Goto Github PK
View Code? Open in Web Editor NEW《深度学习图像识别技术:基于TensorFlow Object Detection API和Intel OpenVINO》
《深度学习图像识别技术:基于TensorFlow Object Detection API和Intel OpenVINO》
P111 下载labelimg 命令写成了labeling
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>for /f %i in ('dir /b *.proto') do protoc %i --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc anchor_generator.proto --python_out=.
object_detection/protos/grid_anchor_generator.proto: File not found.
object_detection/protos/ssd_anchor_generator.proto: File not found.
object_detection/protos/multiscale_anchor_generator.proto: File not found.
anchor_generator.proto:5:1: Import "object_detection/protos/grid_anchor_generator.proto" was not found or had errors.
anchor_generator.proto:6:1: Import "object_detection/protos/ssd_anchor_generator.proto" was not found or had errors.
anchor_generator.proto:7:1: Import "object_detection/protos/multiscale_anchor_generator.proto" was not found or had errors.
anchor_generator.proto:13:5: "GridAnchorGenerator" is not defined.
anchor_generator.proto:14:5: "SsdAnchorGenerator" is not defined.
anchor_generator.proto:15:5: "MultiscaleAnchorGenerator" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc argmax_matcher.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc bipartite_matcher.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc box_coder.proto --python_out=.
object_detection/protos/faster_rcnn_box_coder.proto: File not found.
object_detection/protos/keypoint_box_coder.proto: File not found.
object_detection/protos/mean_stddev_box_coder.proto: File not found.
object_detection/protos/square_box_coder.proto: File not found.
box_coder.proto:5:1: Import "object_detection/protos/faster_rcnn_box_coder.proto" was not found or had errors.
box_coder.proto:6:1: Import "object_detection/protos/keypoint_box_coder.proto" was not found or had errors.
box_coder.proto:7:1: Import "object_detection/protos/mean_stddev_box_coder.proto" was not found or had errors.
box_coder.proto:8:1: Import "object_detection/protos/square_box_coder.proto" was not found or had errors.
box_coder.proto:14:5: "FasterRcnnBoxCoder" is not defined.
box_coder.proto:15:5: "MeanStddevBoxCoder" is not defined.
box_coder.proto:16:5: "SquareBoxCoder" is not defined.
box_coder.proto:17:5: "KeypointBoxCoder" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc box_predictor.proto --python_out=.
object_detection/protos/hyperparams.proto: File not found.
box_predictor.proto:5:1: Import "object_detection/protos/hyperparams.proto" was not found or had errors.
box_predictor.proto:23:12: "Hyperparams" is not defined.
box_predictor.proto:66:12: "Hyperparams" is not defined.
box_predictor.proto:126:12: "Hyperparams" is not defined.
box_predictor.proto:138:12: "Hyperparams" is not defined.
box_predictor.proto:174:12: "Hyperparams" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc eval.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc faster_rcnn.proto --python_out=.
object_detection/protos/anchor_generator.proto: File not found.
object_detection/protos/box_predictor.proto: File not found.
object_detection/protos/hyperparams.proto: File not found.
object_detection/protos/image_resizer.proto: File not found.
object_detection/protos/losses.proto: File not found.
object_detection/protos/post_processing.proto: File not found.
faster_rcnn.proto:5:1: Import "object_detection/protos/anchor_generator.proto" was not found or had errors.
faster_rcnn.proto:6:1: Import "object_detection/protos/box_predictor.proto" was not found or had errors.
faster_rcnn.proto:7:1: Import "object_detection/protos/hyperparams.proto" was not found or had errors.
faster_rcnn.proto:8:1: Import "object_detection/protos/image_resizer.proto" was not found or had errors.
faster_rcnn.proto:9:1: Import "object_detection/protos/losses.proto" was not found or had errors.
faster_rcnn.proto:10:1: Import "object_detection/protos/post_processing.proto" was not found or had errors.
faster_rcnn.proto:29:12: "ImageResizer" is not defined.
faster_rcnn.proto:38:12: "AnchorGenerator" is not defined.
faster_rcnn.proto:45:12: "Hyperparams" is not defined.
faster_rcnn.proto:98:12: "BoxPredictor" is not defined.
faster_rcnn.proto:111:12: "PostProcessing" is not defined.
faster_rcnn.proto:126:12: "HardExampleMiner" is not defined.
faster_rcnn.proto:133:12: "ClassificationLoss" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc faster_rcnn_box_coder.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc graph_rewriter.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc grid_anchor_generator.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc hyperparams.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc image_resizer.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc input_reader.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc keypoint_box_coder.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc losses.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc matcher.proto --python_out=.
object_detection/protos/argmax_matcher.proto: File not found.
object_detection/protos/bipartite_matcher.proto: File not found.
matcher.proto:5:1: Import "object_detection/protos/argmax_matcher.proto" was not found or had errors.
matcher.proto:6:1: Import "object_detection/protos/bipartite_matcher.proto" was not found or had errors.
matcher.proto:12:5: "ArgMaxMatcher" is not defined.
matcher.proto:13:5: "BipartiteMatcher" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc mean_stddev_box_coder.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc model.proto --python_out=.
object_detection/protos/faster_rcnn.proto: File not found.
object_detection/protos/ssd.proto: File not found.
model.proto:5:1: Import "object_detection/protos/faster_rcnn.proto" was not found or had errors.
model.proto:6:1: Import "object_detection/protos/ssd.proto" was not found or had errors.
model.proto:11:5: "FasterRcnn" is not defined.
model.proto:12:5: "Ssd" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc multiscale_anchor_generator.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc optimizer.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc pipeline.proto --python_out=.
object_detection/protos/eval.proto: File not found.
object_detection/protos/graph_rewriter.proto: File not found.
object_detection/protos/input_reader.proto: File not found.
object_detection/protos/model.proto: File not found.
object_detection/protos/train.proto: File not found.
pipeline.proto:5:1: Import "object_detection/protos/eval.proto" was not found or had errors.
pipeline.proto:6:1: Import "object_detection/protos/graph_rewriter.proto" was not found or had errors.
pipeline.proto:7:1: Import "object_detection/protos/input_reader.proto" was not found or had errors.
pipeline.proto:8:1: Import "object_detection/protos/model.proto" was not found or had errors.
pipeline.proto:9:1: Import "object_detection/protos/train.proto" was not found or had errors.
pipeline.proto:15:12: "DetectionModel" is not defined.
pipeline.proto:16:12: "TrainConfig" is not defined.
pipeline.proto:17:12: "InputReader" is not defined.
pipeline.proto:18:12: "EvalConfig" is not defined.
pipeline.proto:19:12: "InputReader" is not defined.
pipeline.proto:20:12: "GraphRewriter" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc post_processing.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc preprocessor.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc region_similarity_calculator.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc square_box_coder.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc ssd.proto --python_out=.
object_detection/protos/anchor_generator.proto: File not found.
object_detection/protos/box_coder.proto: File not found.
object_detection/protos/box_predictor.proto: File not found.
object_detection/protos/hyperparams.proto: File not found.
object_detection/protos/image_resizer.proto: File not found.
object_detection/protos/matcher.proto: File not found.
object_detection/protos/losses.proto: File not found.
object_detection/protos/post_processing.proto: File not found.
object_detection/protos/region_similarity_calculator.proto: File not found.
ssd.proto:4:1: Import "object_detection/protos/anchor_generator.proto" was not found or had errors.
ssd.proto:5:1: Import "object_detection/protos/box_coder.proto" was not found or had errors.
ssd.proto:6:1: Import "object_detection/protos/box_predictor.proto" was not found or had errors.
ssd.proto:7:1: Import "object_detection/protos/hyperparams.proto" was not found or had errors.
ssd.proto:8:1: Import "object_detection/protos/image_resizer.proto" was not found or had errors.
ssd.proto:9:1: Import "object_detection/protos/matcher.proto" was not found or had errors.
ssd.proto:10:1: Import "object_detection/protos/losses.proto" was not found or had errors.
ssd.proto:11:1: Import "object_detection/protos/post_processing.proto" was not found or had errors.
ssd.proto:12:1: Import "object_detection/protos/region_similarity_calculator.proto" was not found or had errors.
ssd.proto:134:14: "Hyperparams" is not defined.
ssd.proto:22:12: "ImageResizer" is not defined.
ssd.proto:28:12: "BoxCoder" is not defined.
ssd.proto:31:12: "Matcher" is not defined.
ssd.proto:34:12: "RegionSimilarityCalculator" is not defined.
ssd.proto:45:12: "BoxPredictor" is not defined.
ssd.proto:48:12: "AnchorGenerator" is not defined.
ssd.proto:51:12: "PostProcessing" is not defined.
ssd.proto:62:12: "Loss" is not defined.
ssd.proto:160:12: "Hyperparams" is not defined.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc ssd_anchor_generator.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc string_int_label_map.proto --python_out=.
(tf_gpu) D:\vrs\tf_train\models\research\object_detection\protos>protoc train.proto --python_out=.
object_detection/protos/optimizer.proto: File not found.
object_detection/protos/preprocessor.proto: File not found.
train.proto:5:1: Import "object_detection/protos/optimizer.proto" was not found or had errors.
train.proto:6:1: Import "object_detection/protos/preprocessor.proto" was not found or had errors.
train.proto:17:12: "PreprocessingStep" is not defined.
train.proto:26:12: "Optimizer" is not defined.
在使用VScode调试object_detection_example_1.py报错The _imagingft C module is not installed
Traceback (most recent call last):
File "e:\MY_PROGRAME\tf_train\object_detection_example_1.py", line 114, in
line_thickness=8)
File "E:\MY_PROGRAME\tf_train\models\research\object_detection\utils\visualization_utils.py", line 744, in visualize_boxes_and_labels_on_image_array
use_normalized_coordinates=use_normalized_coordinates)
File "E:\MY_PROGRAME\tf_train\models\research\object_detection\utils\visualization_utils.py", line 128, in draw_bounding_box_on_image_array
use_normalized_coordinates)
File "E:\MY_PROGRAME\tf_train\models\research\object_detection\utils\visualization_utils.py", line 175, in draw_bounding_box_on_image
font = ImageFont.truetype('arial.ttf', 24)
File "D:\Anaconda3\envs\TensorPyTorch\lib\site-packages\PIL\ImageFont.py", line 853, in truetype
return freetype(font)
File "D:\Anaconda3\envs\TensorPyTorch\lib\site-packages\PIL\ImageFont.py", line 850, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "D:\Anaconda3\envs\TensorPyTorch\lib\site-packages\PIL\ImageFont.py", line 185, in init
if core.HAVE_RAQM:
File "D:\Anaconda3\envs\TensorPyTorch\lib\site-packages\PIL\ImageFont.py", line 44, in getattr
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed
但是在pycharm下运行正常???请问是啥原因。
python是3.6版本的
老师您好,感谢您百忙之中查看此问题。
在学习完书中第三章一键训练模型后,我成功的实现了一键训练猫狗识别的程序。于是我尝试着使用我自己的训练集,按照您的方法对图片进行标注以及训练模型。我成功的完成了模型的训练,也保存了冻结图文件,但是当我运行object_detection_example_2文件,即想看模型对于测试集的训练效果时,运行程序时命令行窗口显示如下错误。Traceback (most recent call last):
File "object_detection_example_2.py", line 11, in
from utils import label_map_util
File "D:\tf_train\models\research\object_detection\utils\label_map_util.py", line 21, in
from object_detection.protos import string_int_label_map_pb2
File "D:\tf_train\workspaces\weights_training_dome1\object_detection.py", line 12, in
from utils import visualization_utils as vis_util
File "D:\tf_train\models\research\object_detection\utils\visualization_utils.py", line 36, in
from object_detection.core import standard_fields as fields
ModuleNotFoundError: No module named 'object_detection.core'; 'object_detection' is not a package
我尝试了网上参考的解决方法,但是没有找到问题的原因。
后来我多次反复在控制台输入 python object_detection_example_2.py又成功执行了test图片的预测。我也不知道为什么会发生这样的事情,希望老师可以指点我一下。
2.x已经出来这么久了 可考虑重要案例进行代码迁移
一、图片上多个重复框问题
我根据您书上的描述,自己选择了220张大货车和小轿车图片,每张图片大小为2064*1672,因此我在ssd_inception_v2_coco.config文件中设置了大小为长宽的1/2, 如下
image_resizer {
fixed_shape_resizer {
height: 836
width: 1032
}
}
二、针对上面的图形,我将
ssd_inception_v2_coco.config文件中设置了大小为长宽的原始大小, 如下
image_resizer {
fixed_shape_resizer {
height: 1672
width: 2064
}
}
进行训练后,推断结果只能出现小轿车的情况,而没有出现大货车的推断,请问这个是怎么回事呢?
资源下载下来打不开,报文件已损坏什么的,两个网盘的都是
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.