The view
operations of data
and target
look strange.
Currently you are using
data = data.view(-1, args.test_batch_size*3*8*8)
target = target.view(-1, args.test_batch_size)
Generally and also based on your model code, you should provide the data as [batch_size, in_features]
and the target as [batch_size]
containing class indices.
Could you change that and try to run your code again?
PS: I’ve formatted your code for better readability. You can add code snippets using three backticks ```