-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Object of type Tensor is not JSON serializable #102
Comments
I pushed a patch in a similar spirit. This is due to how pytorch 0.4 deals with scalar tensors. |
If like me you just wanted to save the dict of tensors in a human readable way check this out: https://discuss.pytorch.org/t/typeerror-tensor-is-not-json-serializable/36065/3 or https://stackoverflow.com/questions/12943819/how-to-prettyprint-a-json-file/66180687#66180687 and fossasia/visdom#554. |
When I run
learning/main.py
with Python 3 and a recent version of pytorch I get the following traceback:This patch fixes the problem:
The text was updated successfully, but these errors were encountered: