prlz77/ResNeXt.pytorch

TypeError: tensor(0, device='cuda:0') is not JSON serializable

zorrocai opened this issue · 3 comments

when I run the codes following your instructions, "TypeError: tensor(0, device='cuda:0') is not JSON serializable" occurs at the line 167 of train.py, and it's the code "log.write('%s\n' % json.dumps(state))".
I wonder whether it caused by the version of pytorch or the version of python? I use Pytorch 4.0 python 2.7 now.

I think the problem is that some float from pytorch 3.0 now it has become a variable or a tensor, it should be easy to fix, Iet me see...

I think it's solved now, could you please try again with the updated version?

yes, it works~