cast weight to float64 too