def net():
"""Delay loading the net until the last possible moment.
Loading the net is SLOW and produces a ton of terminal garbage.
Also we want to wait to load it until we have called some other
caffe initializations code (caffe.set_mode_gpu(), caffe.set_device(0), etc)
"""
global __net
if __net is None:
__net = caffe.Net(LAYERS, WEIGHTS, caffe.TEST)
return __net
评论列表
文章目录