Hi
I tried to use torch.optim.lr_scheduler.ReduceLROnPlateau to manipulate the learning rate. I followed the example in the doc:
Example:
            >>> optimizer = torch.optim.SGD(model.parameters(), lr=0.1, momentum=0.9)
            >>> scheduler = torch.optim.ReduceLROnPlateau(optimizer, 'min')
            >>> for epoch in range(10):
            >>>     train(...)
            >>>     val_loss = validate(...)
            >>>     # Note that step should be called after validate()
            >>>     scheduler.step(val_loss)

However, I got an error as:
Traceback (most recent call last):
  File "train.py", line 676, in <module>
    main()
  File "train.py", line 233, in main
    scheduler.step(val_loss)
  File "/usr/local/lib/python2.7/dist-packages/torch/optim/lr_scheduler.py", line 258, in step
    if self.is_better(current, self.best):
  File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 123, in __bool__
    torch.typename(self.data) + " is ambiguous")
RuntimeError: bool value of Variable objects containing non-empty torch.cuda.ByteTensor is ambiguous

Can someone please tell me what is going on here and what should i do?
Many thanks