Comments (10)
@mickvanhulst I merged the pool request, thank you a lot! @jmaister - it finally works (with current repo master or will work with 0.2.3
and above).
Just use PlotLosses(fig_path="./plot.png")
or PlotLossesKeras(fig_path="./plot.png")
(not file_name
:) ).
from livelossplot.
Hey @mrmitzh, this is my first response on Github ever. It comes kinda late compared to the discussion, but I've just been confronted with the same issue of not being able so save the graphs. I'm using PlotLossesKerasTF()
and fig_path = 'filename.png'
isn't working. After digging a bit into the code (I'm not an expert lol), I found that MatplotlibPlot()
has a figpath
argument.
So the solution for me, using Jupyter Notebook is :
from livelossplot import PlotLossesKerasTF
from livelossplot.outputs import MatplotlibPlot
live_loss = PlotLossesKerasTF(outputs=[MatplotlibPlot(figpath ="graph.png")])
from livelossplot.
You mean - the final graph or an animation?
Both are doable.
from livelossplot.
The final graph.
How can it be done?
from livelossplot.
if you have a plan for this feature, is it doable to save the image as a vector file?
I mean, if the saved image is a vector file, it doesn't get blurred when we zoom in.
Thank you very much for your work.
from livelossplot.
OK, I saw it and it is not as straightforward as I thought. plt.savefig
does not work, since it is after plt.show
.
If it is notebook, you can right click and save it. For other options it depends if you want to do it instead of showing (I can add it easily), or along with (need to check).
from livelossplot.
Just weighing in here: saving is of importance when doing e.g. K-fold cross-validation. As it's live, the graphs are overwritten meaning that previous data is lost. If we want to do cross-validation in one cell, then we need to save the figures somewhere else.
I've circumvented this by saving the objects in a list and then printing them out and manually saving them afterwards, but this is obviously not optimal.
Any suggestions?
from livelossplot.
@mickvanhulst If you know how to do that, I am open to Pull Requests. Otherwise, I don't have much time for this project right now.
from livelossplot.
@stared I've sent a pull request. I've basically added two parameters (save_img and file_name), which can be used to save the image. Every time the draw function is called, the image will be saved. I've tested the method for Pytorch thus far. Let me know if any other changes are required.
In terms of documentation, I don't want to ruin the style you've created, so feel free to amend the following:
To save the plot, add save_img=True and add the file_name parameter with the directory, filename and file name extension (e.g. file_name='./folder_1/filename.png') as parameters when calling PlotLosses().
from livelossplot.
The following code doesn't work in the latest version of livelossplot.
PlotLosses(fig_path="./plot.png")
Do we have other ways to save the figure generated?
from livelossplot.
Related Issues (20)
- KeyError : 'metrics' Please Help HOT 7
- How to plot live loss XGBOOST training? HOT 1
- Bug with latest keras HOT 3
- Bokeh vis not working in Colab HOT 2
- Can't pass arguments to PlotLossesKerasTF (figsize, fig_path) HOT 1
- Custom Message (Batch Size, etc) HOT 2
- How to plot multiple validation sets HOT 4
- Setup outputs as str HOT 6
- Make xlabel customizable HOT 4
- Sudden error that wasn't happen before - index 0 is out of bounds for axis 0 with size 0 HOT 1
- Positioning of legends HOT 1
- sliding start of epochs HOT 2
- WARNING : tensorflow:Callback method `on_train_batch_end` is slow compared to the batch time HOT 2
- PlotLossesKeras stops if tensorflow.keras is used without installing traditional keras HOT 2
- No plots showing for utils.Sequence Generator model HOT 3
- how to plot by batches?
- 'Plot2d' object has no attribute 'set_output_mode' HOT 1
- Ability to pass `figsize` for matplotlib plots
- ImageDataGenerator incompatible
- Training pauses on epoch end and won't continue until window is closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livelossplot.