We consider the notion of a (q, m)-polymatroid, due to Shiromoto, and the more general notion of (q, m)-demi-polymatroid, and show how generalized weights can be defined for them. Further, we establish a duality for these weights analogous to Wei duality for generalized Hamming weights of linear codes. The corresponding results of Ravagnani for Delsarte rank metric codes, and Martínez-Peñas and Matsumoto for relative generalized rank weights are derived as a consequence.