Why OrderDict here

Hey, I am learning Faster-rcnn by reading the source code,
i don’t know why here using Order Dict

This is passed as a parameter to the self.rpn function on the next line.

and In rpn turn the Order dict into an array

I think here is a reason, can someone help me ?

I assume the OrderedDict is used to guarantee that the passed features are in the right order.
Depending on the Python version features.values() might reorder the values, which would yield a wrong behavior.

From the Python2 docs:

CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the dictionary’s history of insertions and deletions.

Python 3 docs:

Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end.
Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.