Do not use integer size for weights dictionary for json-compatibility
Changelog, version 2.10.2