Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.pytorch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.pytorch
Commits
5878e035
Commit
5878e035
authored
5 years ago
by
Anjith GEORGE
Browse files
Options
Downloads
Plain Diff
Merge branch 'fixes_plot' into 'master'
Use matplotlib to save images See merge request
!37
parents
d25aaf5f
40c5f1dc
No related branches found
No related tags found
1 merge request
!37
Use matplotlib to save images
Pipeline
#32773
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/pytorch/trainers/tflog.py
+2
-2
2 additions, 2 deletions
bob/learn/pytorch/trainers/tflog.py
with
2 additions
and
2 deletions
bob/learn/pytorch/trainers/tflog.py
+
2
−
2
View file @
5878e035
# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
import
tensorflow
as
tf
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
import
scipy.misc
import
matplotlib.pyplot
as
plt
try
:
try
:
from
StringIO
import
StringIO
# Python 2.7
from
StringIO
import
StringIO
# Python 2.7
except
ImportError
:
except
ImportError
:
...
@@ -29,7 +29,7 @@ class Logger(object):
...
@@ -29,7 +29,7 @@ class Logger(object):
s
=
StringIO
()
s
=
StringIO
()
except
:
except
:
s
=
BytesIO
()
s
=
BytesIO
()
scipy
.
misc
.
toimage
(
img
).
save
(
s
,
format
=
"
png
"
)
plt
.
imsave
(
s
,
img
,
format
=
'
png
'
)
# Create an Image object
# Create an Image object
img_sum
=
tf
.
Summary
.
Image
(
encoded_image_string
=
s
.
getvalue
(),
img_sum
=
tf
.
Summary
.
Image
(
encoded_image_string
=
s
.
getvalue
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment