You need to be more specific in your error. Maybe paste the line in the code to which the error is associated. All I know from looking from your error is that some variable in your code is expecting a numpy variable and your code is  providing it with a torch tensor variable. It would be very hard to say what you are doing wrong. It would be like my code gives the error (expected character got integer).