Your model (its forward function) returns a tuple (x,x1) and not a tensor.
And below, you use this tuple to try to calculate the loss function, hence the error.
# ...
recon = model(img) # x, x2
loss = criterion(recon, img)
# ...

I don’t know what you want to achieve as a goal, but looking at it I think it’s x that you want to use in the loss function.
loss = criterion(recon[0], img)