Yeah. I’ll find how to resize torch tensor image by not using detach() and numpy().
But without using detach() and numpy(),
and with the circumstance where I change this sentence
https://github.com/youngminpark2559/test/blob/master/update_CNN/train/train.py#L164

to
en_i_loss=Variable(en_i_loss,requires_grad=True)

All epochs can be done.
But loss value still shows constant, which means CNN is not updated like this
Total number of parameters: 224481
en_i_loss tensor(8.7888, device='cuda:0', requires_grad=True)
en_i_loss.grad tensor(1., device='cuda:0')
Saved model at end of iteration
en_i_loss tensor(8.7888, device='cuda:0', requires_grad=True)
en_i_loss.grad tensor(1., device='cuda:0')
Saved model at end of iteration
en_i_loss tensor(8.7888, device='cuda:0', requires_grad=True)
en_i_loss.grad tensor(1., device='cuda:0')
Saved model at end of iteration
Saved model at end of epoch
Train finished

And above CNN not being updated issue was my first issue.
Implementing custom loss function is attempt to resolve that first issue.