Hello Esta!



 esta:

I get the error “IndexError: Target 1 is out of bounds.”
…
    loss = (criterion1(F.softmax(output1),target) + criterion2(output2a, target_f) + criterion3(F.softmax(output2b), target))



You don’t say what kind of problem you are trying to solve, you don’t
tell us what model2 and model3` are, and you don’t indicate what your
data look like, so we will have to explore …
Print out the shapes of the tensors output1, output2a, output2b,
target, and target_f just before you call your loss line.
(As an aside, if you are using CrossEntropyLoss you will most likely
want to leave out the calls to softmax() as CrossEntropyLoss has,
in effect, softmax() built in.)
Best.
K. Frank