Embedding(): argument 'indices' (position 2) must be Tensor, not builtin_function_or_method

Hello, can anyone explain me this error and help me to resolve it. I am trying to get the predictions for my RNN trained model. However, while generating the predictions I’m having this error.

embedding(): argument ‘indices’ (position 2) must be Tensor, not builtin_function_or_method

Here is the code and error snippet.

Variable named as network is the name of my training model.

Based on the error message the second argument (prediction_loader) is passed as the input to the model, which is a DataLoader instance and will thus fail.
Pass tensors to the model by iterating the DataLoader instead.

1 Like

It got resolved! Thanks for the help.