-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedOpen to be worked onOpen to be worked onloggingRelated to the `LoggerConnector` and `log()`Related to the `LoggerConnector` and `log()`
Milestone
Description
🐛 Bug
self.log('d_acc_dummy' , 100.0, on_step=True, on_epoch=True, sync_dist=True)
results in
/usr/local/lib/python3.6/dist-packages/pytorch_lightning/core/step_result.py in log(self, name, value, prog_bar, logger, on_step, on_epoch, reduce_fx, tbptt_reduce_fx, tbptt_pad_token, enable_graph, sync_dist, sync_dist_op, sync_dist_group, sync_fn)
138 is_dist_initialized = torch.distributed.is_available() and torch.distributed.is_initialized()
139 # TODO: Find a way to make the reduction only once, so we don't need to clone.
--> 140 value = value.clone() if is_dist_initialized else value
141 value = sync_fn(value, group=sync_dist_group, reduce_op=sync_dist_op)
142
AttributeError: 'float' object has no attribute 'clone'
Float is allowed type (from step_result.py)
if sync_dist and isinstance(value, (torch.Tensor, numbers.Number)):
is_dist_initialized = torch.distributed.is_available() and torch.distributed.is_initialized()
# TODO: Find a way to make the reduction only once, so we don't need to clone.
value = value.clone() if is_dist_initialized else value
value = sync_fn(value, group=sync_dist_group, reduce_op=sync_dist_op)
Please reproduce using [the BoringModel and post here]
To Reproduce
Expected behavior
Logging of float values
Environment
- CUDA:
- GPU:
- Tesla T4
- available: True
- version: 10.1
- GPU:
- Packages:
- numpy: 1.18.5
- pyTorch_debug: True
- pyTorch_version: 1.7.0+cu101
- pytorch-lightning: 1.0.8
- tqdm: 4.41.1
- System:
- OS: Linux
- architecture:
- 64bit
- processor: x86_64
- python: 3.6.9
- version: Proposal for help #1 SMP Thu Jul 23 08:00:38 PDT 2020
Additional context
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedOpen to be worked onOpen to be worked onloggingRelated to the `LoggerConnector` and `log()`Related to the `LoggerConnector` and `log()`