Tensorflow_Object_Detection

tensorflow官方GitHub:https://github.com/tensorflow/models/tree/master/research/object_detection
背景:
将官方Object-Detection用PyCharm进行构建。官方给的实例可以用jupyter notebook直接运行object_detection_tutorial.ipynb来完成object的识别,而我想用pyCharm运行,于是尝试将object_detection_tutorial.ipynb中的代码复制粘贴出来形成新的脚本。


问题1:

在新的脚本中由于object_detection_tutorial.ipynb是用ipython实现的,所以 %matplotlib inline不识别。

解决方法:
直接将这句去掉即可。(我是没发现有什么影响)。

问题2:

运行过程中报错:

This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile

from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
from utils import label_map_util
from utils import ops as utils_ops
from utils import visualization_utils as vis_util

解决方法:

import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile

from collections import defaultdict
from io import StringIO

from PIL import Image
from utils import label_map_util
from utils import ops as utils_ops
from utils import visualization_utils as vis_util
from matplotlib import pyplot as plt

from matplotlib import pyplot as plt放到最后就不会出现了。

github地址:https://github.com/zhonglihanzhu/tensorflow-objectDetection

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容