Pls help
train.py:222: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number
losses.update(loss.data[0], target.size(0))
train.py:223: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number
train_writer.add_scalar('train_loss', loss.data[0], n_iter)
train.py:225: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number
depth2_metric_errors.update(depth2_metric_error.data[0], target.size(0))
- Avg Loss : 8.032, Avg Depth error : 16.633, normalized : 1.154
100% (2813 of 2813) |########################################| Elapsed Time: 5:35:49 ETA: 00:00:00
dfdepth2_normalized_errors.update(depth2_norm_error.data[0], target.size(0))
train.py:239: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. UsN/A% (0 of 219) | | Elapsed Time: 0:00:00 ETA: --:--:--
writer.writerow([loss.data[0], depth2_metric_error.data[0]])
train.py:269: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
input_var = torch.autograd.Variable(torch.cat(input_tensors, 1), volatile=True)
train.py:270: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
target_var = torch.autograd.Variable(target, volatile=True)
Traceback (most recent call last):
File "/home/jc/.local/lib/python3.6/site-packages/PIL/Image.py", line 2460, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 64), '|u1')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 301, in
main()
File "train.py", line 158, in main
depth_error, normalized = validate(val_loader, model, epoch, term_logger, output_writers)
File "train.py", line 276, in validate
output_writers[i].add_image('GroundTruth', util.tensor2array(target[0].cpu(), max_value=100), 0)
File "/usr/local/lib/python3.6/dist-packages/tensorboardX/writer.py", line 412, in add_image
File "/usr/local/lib/python3.6/dist-packages/tensorboardX/summary.py", line 205, in image
image = make_image(tensor, rescale=rescale)
image = Image.fromarray(tensor)
File "/home/jc/.local/lib/python3.6/site-packages/PIL/Image.py", line 2463, in fromarray
TypeError: Cannot handle this data type