Skip to content

Commit 1f5dc8a

Browse files
AlexeyKozhevinroman-kh
authored andcommitted
Fix plot (#782)
* Fix plot * Updates for torch.GradScaler
1 parent 0c483e7 commit 1f5dc8a

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
[![PyTorch](https://img.shields.io/badge/PyTorch-2.0-orange.svg)](https://pytorch.org)
44
[![codecov](https://codecov.io/gh/analysiscenter/batchflow/branch/master/graph/badge.svg)](https://codecov.io/gh/analysiscenter/batchflow)
55
[![PyPI](https://badge.fury.io/py/batchflow.svg)](https://badge.fury.io/py/batchflow)
6-
<<<<<<< HEAD
76
[![Status](https://github.com/analysiscenter/batchflow/actions/workflows/status.yml/badge.svg?branch=master)](https://github.com/analysiscenter/batchflow/actions?query=workflow%3Astatus)
8-
=======
9-
[![Status](https://github.com/analysiscenter/batchflow/workflows/status.yml/badge.svg?branch=master)](https://github.com/analysiscenter/batchflow/actions?query=workflow%3Astatus)
10-
>>>>>>> e81a745f (Update status badge)
117

128

139
# BatchFlow

batchflow/models/torch/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ def make_infrastructure(self):
683683
self.make_loss()
684684
self.make_optimizer()
685685
self.make_decay()
686-
self.scaler = torch.cuda.amp.GradScaler()
686+
self.scaler = torch.GradScaler("cuda")
687687

688688
self.setup_gradient_clipping()
689689
self.setup_weights_averaging()

batchflow/plotter/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,10 +855,10 @@ def clear(self):
855855

856856
self.annotations = {}
857857

858-
self.ax.clear()
859858
for layer in self.layers:
860859
for obj in layer.objects:
861860
obj.remove()
861+
self.ax.clear()
862862
self.layers = []
863863

864864

0 commit comments

Comments
 (0)