DHZS / tf-deformable-conv-layer

TensorFlow implementation of Deformable Convolutional Layer
MIT License
82 stars 37 forks source link

Fails to build #2

Closed tom-bu closed 5 years ago

tom-bu commented 5 years ago

I get this error when I build the model. Batch size is usually set to None, so I'm not sure why it expects a number here.

--> 110         batch_size = int(inputs.get_shape()[0])
    111         channel_in = int(inputs.get_shape()[-1])
    112         in_h, in_w = [int(i) for i in inputs.get_shape()[1: 3]]  # input feature map size

TypeError: __int__ returned non-int (type NoneType)
DHZS commented 5 years ago

Sorry, the code can only run in tf eager execution.

tom-bu commented 5 years ago

How difficult is it to make it available not in eager execution? I'd be willing to spend some time on this, but kind of need some guidance.

tom-bu commented 5 years ago

Are deformable convolutions still popularly used or are there better layers out there that perform similarly?

DHZS commented 5 years ago

I think it's not difficult to convert the code in graph execution. However, my re-implementation is not efficient, because I use high level TensorFlow API in my code. You can use c++ implementation in your project.

Deformable conv is still useful in object detection, since it can adjust the receptive field and sample location dynamically according to the feature. For more detail, you can refer to the following papers:

mdv3101 commented 4 years ago

@tom-bu Did you get success in converting it to non-eager executable code? @DHZS can you help in this?