The stack trace
    runfile('/somestuff/pytorch_projects/trainer.py', wdir='/somestuff/pytorch_projects')

  File "/home/someone/anaconda3/envs/pytorch/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 786, in runfile
    execfile(filename, namespace)

  File "/home/someone/anaconda3/envs/pytorch/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/somestuff/pytorch_projects/trainer.py", line 318, in <module>
    main()

  File "/somestuff/pytorch_projects/trainer.py", line 298, in main
    test(i, test_loss_list)

  File "/somestuff/pytorch_projects/trainer.py", line 252, in test
    save_image(subject['image_name'], image.cpu().detach().numpy(), np.array(list(subject['affine'])), epoch, params['epoch_dir'])

ValueError: only one element tensors can be converted to Python scalars