shouldn't this be ValueError?

Also, shouldn't "size" be "shape"?