Anyone got a tip for this? This is the code and error it gives:
# Training
trg_loss = [] 
forward_model.train()
with torch.set_grad_enabled(True):
    for data_library['100MHz'], data_library['250MHz'] in training_generator:
        if(core_num>1):
            Parallel(n_jobs=core_num)
            #print(data_library['20MHz'].shape)
            delayed(train)(data_library[prior],data_library[target])
        else:
            new_loss = train(data_library[prior],data_library[target])
            trg_loss.append(new_loss)
        # Parallel(n_jobs=core_num)
        # print(data_library['20MHz'].shape)
        # delayed(train)(data_library[prior],data_library[target])
#print("\nTraining Loss: ", sum(trg_loss).detach().numpy().max()/len(trg_loss))
FILE.write("\nEpoch "+str(epoch)+": Training Loss = " +str(sum(trg_loss).detach().numpy().max()/len(trg_loss)))

with the error being:
AttributeError: ‘int’ object has no attribute 'detach’