This paper designs a method that can generate anchors of various shapes for the object detection framework. This method has the characteristics of novelty and flexibility. Different from the previous anchors generated by a pre-defined manner, our anchors are generated dynamically by an anchor generator. Specially, the anchor generator is not fixed but learned from the hand-designed anchors, which means that our anchor generator is able to work well in various scenes. In the inference time, the weights of anchor generator are estimated by a simple network where the input is some hand-designed anchor. In addition, in order to make the difference between the number of positive and negative samples smaller, we use an adaptive IOU threshold related to the object size to solve this problem. At the same time, we proved that our proposed method is effective and conducted a lot of experiments on the COCO dataset. Experimental results show that after replacing the anchor generation method in the previous object detectors (such as SSD, mask RCNN, and Retinanet) with our proposed method, the detection performance of the model has been greatly improved compared to before the replacement, which proves our method is effective.