I am not sure what your dataset returns, but usually it returns a tuple of tensors (x and y). Can you replace
for batch_idx, inputs in enumerate(validloader):

with
for batch_idx, (inputs,outputs) in enumerate(validloader):