Tensorflow_Object_Detection

tensorflow官方GitHub:https://github.com/tensorflow/models/tree/master/research/object_detection
背景:
將官方Object-Detection用PyCharm進(jìn)行構(gòu)建。官方給的實(shí)例可以用jupyter notebook直接運(yùn)行object_detection_tutorial.ipynb來(lái)完成object的識(shí)別,而我想用pyCharm運(yùn)行,于是嘗試將object_detection_tutorial.ipynb中的代碼復(fù)制粘貼出來(lái)形成新的腳本。


問(wèn)題1:

在新的腳本中由于object_detection_tutorial.ipynb是用ipython實(shí)現(xiàn)的,所以 %matplotlib inline不識(shí)別。

解決方法:
直接將這句去掉即可。(我是沒(méi)發(fā)現(xiàn)有什么影響)。

問(wèn)題2:

運(yùn)行過(guò)程中報(bào)錯(cuò):

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放到最后就不會(huì)出現(xiàn)了。

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

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容