misc fixes

This commit is contained in:
wassname
2020-02-01 13:09:01 +08:00
parent d28f588778
commit 5dfcd6e54f
3 changed files with 15 additions and 6 deletions
+1
View File
@@ -108,6 +108,7 @@ def plot_from_loader_to_tensor(
# Send fig to tensorboard
buf = io.BytesIO()
plt.savefig(buf, format='jpeg')
plt.close()
buf.seek(0)
image = PIL.Image.open(buf)
image = ToTensor()(image)#.unsqueeze(0)