ptrblck:

.item()


Dear @ptrblck
Thank you for your prompt answer.
I got the error in the line:
loss.backward(retain_graph=True), The program breaks after some Iterations (for about 2000). This also includes the update of the meta_opt and the release of the losses.
If I try to use losses.append(loss.item()), the program then give the error:
File "meta_train.py", line 116, in train
    meta_loss.backward()                # Meta-backward pass
AttributeError: 'float' object has no attribute 'backward'

so I suppose that I still need the graph, at least until complete the meta_optimizer.step().