What is not working ? I am pretty sure this library is framework agnostic. I am using it with pytorch 0.4.0
if isinstance(x, torch.autograd.Variable):
x = x.data
in x2num.py is no longer needed. It caused an error in my code, so I commented it out, but I forget how to reproduce the error.
@JindongJiang Before trying to reproduce, did you uncomment then test again?
Hi, before trying to reproduce, I didn't uncomment it but I edited it
if isinstance(x, torch.Tensor):
x = x.data
and I still don't remember why I did this.
But I found another computer just now trying to reproduce it given that my computer is training a network. And I couldn't reproduce it also, it works well without commented. So I figure it might be just a mistake in my coding.
Thanks.
Hi,
I got the same error when using tensorboardX 0.8.
After upgrading to latest tensorboardX 1.2 I believe, the error is gone.
How to upgrade: pip install tensorboardX --upgrade
Error trace if you still need it:
Traceback (most recent call last):
File "train.py", line 309, in <module>
train()
File "train.py", line 257, in train
writer.add_scalar('data/cost', cost, iteration)
File "/root/miniconda3/lib/python3.6/site-packages/tensorboardX/writer.py", line 262, in add_scalar
self.file_writer.add_summary(scalar(tag, scalar_value), global_step)
File "/root/miniconda3/lib/python3.6/site-packages/tensorboardX/summary.py", line 87, in scalar
scalar = makenp(scalar)
File "/root/miniconda3/lib/python3.6/site-packages/tensorboardX/x2num.py", line 14, in makenp
return pytorch_np(x, modality)
File "/root/miniconda3/lib/python3.6/site-packages/tensorboardX/x2num.py", line 22, in pytorch_np
if isinstance(x, torch.autograd.variable.Variable):
AttributeError: 'function' object has no attribute 'Variable'
@jalola Hi,
That's the exact same error I got earlier. I remember it now.
Thank you so much