yhenon / keras-spp

Spatial pyramid pooling layers for keras
MIT License
394 stars 143 forks source link

"TypeError: slice indices must be integers...." on roi_pooling and roi_pooling_conv #23

Open jingweimo opened 6 years ago

jingweimo commented 6 years ago

I installed the keras-spp package in my anaconda python 3.5 environment. The keras in use is supported by either "theano" or "tensorflow" backend. But running both test files test_roi_pooling and test_roi_pooling_conv.py give similar errors on TypeError. For example, when the keras use "tensorflow":

test_roi_pooling.py", line 54, in <module>
     X_curr = X_img[0, X_roi[0, roi, 0]:X_roi[0, roi, 2], X_roi[0, roi, 1]:X_roi[0, roi, 3], :]

TypeError: slice indices must be integers or None or have an __index__ method

test_roi_pooling_conv.py", line 59, in <module>
   X_roi[0, roi, 0]:X_roi[0, roi, 0] + X_roi[0, roi, 2], :]

TypeError: slice indices must be integers or None or have an index method