def __init__(self, use_gpu=True, model=[]):
'''
Init net.
:param model: Network definition.
'''
if model == []:
raise("model should not be empty!")
print("Init NetTester: Use gpu: {}").format(use_gpu)
print("Network: {}").format(model)
if use_gpu:
caffe.set_device(0)
caffe.set_mode_gpu()
else:
caffe.set_mode_cpu()
self.__net = caffe.Net(model, caffe.TRAIN)
评论列表
文章目录