I can also succeessfully run your code after opening a new console and do not train the network. While in my case, the error occurs during the training, e.g., output = net_G(input), output_indexed = output[[0,0,1,1], [0,0,1,2]], that’s it.