From: Jonathan L Long Date: Tue, 11 Mar 2014 03:38:39 +0000 (-0700) Subject: Update detector.py to use the new Net/blobs interface X-Git-Tag: submit/tizen/20180823.020014~739^2~23^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac1bc6fcdf92bbdd214b9b40740c0a266a14e423;p=platform%2Fupstream%2Fcaffeonacl.git Update detector.py to use the new Net/blobs interface --- diff --git a/python/caffe/detection/detector.py b/python/caffe/detection/detector.py index 1dcb797..021a8de 100644 --- a/python/caffe/detection/detector.py +++ b/python/caffe/detection/detector.py @@ -332,7 +332,7 @@ def config(model_def, pretrained_model, gpu, image_dim, image_mean_file): # Initialize network by loading model definition and weights. t = time.time() print("Loading Caffe model.") - NET = caffe.CaffeNet(model_def, pretrained_model) + NET = caffe.Net(model_def, pretrained_model) NET.set_phase_test() if gpu: NET.set_mode_gpu() @@ -340,7 +340,7 @@ def config(model_def, pretrained_model, gpu, image_dim, image_mean_file): # Configure for input/output data IMAGE_DIM = image_dim - CROPPED_DIM = NET.blobs()[0].width + CROPPED_DIM = NET.blobs.values()[0].width IMAGE_CENTER = int((IMAGE_DIM - CROPPED_DIM) / 2) # Load the data set mean file @@ -349,8 +349,8 @@ def config(model_def, pretrained_model, gpu, image_dim, image_mean_file): CROPPED_IMAGE_MEAN = IMAGE_MEAN[IMAGE_CENTER:IMAGE_CENTER + CROPPED_DIM, IMAGE_CENTER:IMAGE_CENTER + CROPPED_DIM, :] - BATCH_SIZE = NET.blobs()[0].num # network batch size - NUM_OUTPUT = NET.blobs()[-1].channels # number of output classes + BATCH_SIZE = NET.blobs.values()[0].num # network batch size + NUM_OUTPUT = NET.blobs.values()[-1].channels # number of output classes if __name__ == "__main__":