The first error is created, since input seems to be a numpy array.
You can check the type via print(type(input)).
Could you post the complete error message for the second issue and which line of code is raising this error?