Skip to content

PyCaffe: slowdown of GPU acceleration (CPU is ok) #6031

@AleximusOrloff

Description

@AleximusOrloff

Hi all, sorry, but I insist that issue #6022 still open

Issue summary

Forward pass speed depends on previous image size

Steps to reproduce

h=16
w=16
im_data = np.empty([h, w, 3])
print(im_data.shape)
im_data = np.swapaxes(im_data, 0, 2)
im_data = np.array([im_data], dtype = np.float)
Net.blobs['data'].reshape(1, 3, w, h)
Net.blobs['data'].data[...] = im_data
k=0
start_time = time.time()
while k<100:
        out = Net.forward()
        k=k+1
print "Time to pass 16x16 = %f" %(time.time() - start_time)
h=512
w=512
im_data = np.empty([h, w, 3])
print(im_data.shape)
im_data = np.swapaxes(im_data, 0, 2)
im_data = np.array([im_data], dtype = np.float)
Net.blobs['data'].reshape(1, 3, w, h)
Net.blobs['data'].data[...] = im_data
k=0
start_time = time.time()
while k<100:
        out = Net.forward()
        k=k+1
print "Time to pass 512x512 = %f" %(time.time() - start_time)
h=16
w=16
im_data = np.empty([h, w, 3])
print(im_data.shape)
im_data = np.swapaxes(im_data, 0, 2)
im_data = np.array([im_data], dtype = np.float)
Net.blobs['data'].reshape(1, 3, w, h)
Net.blobs['data'].data[...] = im_data
k=0
start_time = time.time()
while k<100:
        out = Net.forward()
        k=k+1
print "Time to pass 16x16 once again = %f" %(time.time() - start_time)

result >>
(16, 16, 3)
Time to pass 16x16 = 0.139678
(512, 512, 3)
Time to pass 512x512 = 1.097116
(16, 16, 3)
Time to pass 16x16 once again = 0.900323

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions