Based on the error message you are passing a list to the model while a tensor is expected.
You could check the type of the input via print(type(data)) and make sure that it’s a tensor.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.