Conv2D: Padding TypeError

System information

Environment: Colab


I want to solve this error.

Error Code

In detail

I try EfficientNetB0. And I use ConV2D. train dataset is work well. But test dataset not work. I think It’s problem Padding data type. But I don’t know how can solve this problem?
Plz help me

The error message states that you are passing a DataLoader instance to F.conv2d, which is wrong, so make sure to pass the input tensors to this operation instead.

PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier :wink:

@ptrblck Thank for your answer and advice. I don’t know how solve this problem…
Can see some example?

You are passing the DataLoader directly to the model in:


while you would have to iterate the DataLoader and pass the input tensors to the model.
Take a look at this tutorial for a simple example.
In your case something like:

for data, target in test_loader:
    output = model(data)

should work.

1 Like