This has me puzzled. Your code works but when I try to run the same (well almost):
def species_length_loss(input, target):
    target = th.autograd.Variable(th.randn(32,2).random_(0,8).float(), requires_grad=False).cuda() # JUST TO TEST

    input_species = input[:,:8]
    input_length  = input[:, 8]

    target_species = target[:,0].long()
    target_length  = target[:,1]

    loss = nn.MSELoss()(input_length, target_length) * 1e-4 # + F.nll_loss(input_species, target_species) 
    return loss

It fails as before. I’ve made sure target  requires_grad=False but still I’m getting the same error:
Traceback (most recent call last):
  File "fish.py", line 191, in <module>
    trainer.fit_loader(train_loader, valid_loader, num_epoch=200, verbose=1, cuda_device=0)
  File "build/bdist.linux-x86_64/egg/torchsample/modules/module_trainer.py", line 367, in fit_loader
  File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 156, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
  File "/usr/local/lib/python2.7/dist-packages/torch/autograd/__init__.py", line 98, in backward
    variables, grad_variables, retain_graph)
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation```