ZhouYanzhao / ORN

Oriented Response Networks, in CVPR 2017
http://yzhou.work/ORN
BSD 3-Clause "New" or "Revised" License
223 stars 51 forks source link

PyTorch Using filters with kernel_size=1 causes exception. #8

Closed utkarsh-VRL closed 7 years ago

utkarsh-VRL commented 7 years ago

Exception: 'int' object does not support indexing, for line _kernel = kernel_indices[kW][angle][j]_

Wrapping the kernel_indices for size 1 as a list fixes the issue. New kernel_indices:

    kernel_indices = {
        1: {
            0: [1],
            45: [1],
            90: [1],
            135: [1],
            180: [1],
            225: [1],
            270: [1],
            315: [1]
        },
        3: {
            0: (1,2,3,4,5,6,7,8,9),
            45: (2,3,6,1,5,9,4,7,8),
            90: (3,6,9,2,5,8,1,4,7),
            135: (6,9,8,3,5,7,2,1,4),
            180: (9,8,7,6,5,4,3,2,1),
            225: (8,7,4,9,5,1,6,3,2),
            270: (7,4,1,8,5,2,9,6,3),
            315: (4,1,2,7,5,3,8,9,6)
        }
    }
ZhouYanzhao commented 7 years ago

Fixed. Thanks! ea39618ce248d567b69ef3383ee7a4e22e50844d