prlz77 / ResNeXt.pytorch

Reproduces ResNet-V3 with pytorch
MIT License
505 stars 121 forks source link

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

Closed zorrocai closed 6 years ago

zorrocai commented 6 years ago

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.

prlz77 commented 6 years ago

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...

prlz77 commented 6 years ago

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

zorrocai commented 6 years ago

yes, it works~