Visdom: Is there anyway to save json file without starting visdom server?

Created on 27 Feb 2019  路  8Comments  路  Source: fossasia/visdom

I run my project on my company's remote servers. But it doesn't allow me to start a web server on it for a long time. That means, after some hours. The administer will kill my visdom server.

After my visdom server was killed, my python project soonly crashed.

So, I wonder:

  1. How to avoid being crashed after the visdom server is killed?
  2. Is there anyway to save the json file without running the visdom server? If so, I can start my visdom server only when needed.

Most helpful comment

Hi @taodav. Sorry for the delay in being able to get back to this. So the big issue is that logging only happened after successful calls due to the original implementation. I'm putting out a version that allows logging to occur both on non-successful calls as well as a flag for visdom to run in offline mode, which will generate a log you can play back later on another machine.

All 8 comments

At the moment, you should be able to manage this by using visdom.Visdom(log_to_filename=...) and putting exception handling around your visdom plotting calls. This will cause visdom to write its commands to a local log file that you can later play back to the webserver with vis.replay_log(log_filename). We don't currently support this behavior without the extra hoop of exception handling on your plot calls.

Note the log file is not a .json file, as it is the server that handles the computation of the env state. The log file will be a recording of the calls that will be needed to make to the server reconstruct whatever would have occurred during a particular run.

is there an example of this anywhere?

@taodav we haven't included an example in the demo, but the documentation is in the main README. As in the above, your code would look something like:

# During run
vis = visdom.Visdom(log_to_filename='vis_log_file')
try: 
    vis.text('hello world')
except Exception as e:
    pass

# After run
vis.replay_log('vis_log_file')

As far as the exception handling goes, one issue was noted in #576 that I'll be fixing soon that is preventing the exceptions from being properly bounded.

@JackUrb Thanks for getting back to me! I tried instantiating visdom without the server and got a ConnectionRefusedError which makes sense seeing as there's no server for visdom to ping. But my plotting still doesn't seem to work. Any suggestions?

is anything being written to your log file?

nope, doesn't seem to be logging anything.

Hi @taodav. Sorry for the delay in being able to get back to this. So the big issue is that logging only happened after successful calls due to the original implementation. I'm putting out a version that allows logging to occur both on non-successful calls as well as a flag for visdom to run in offline mode, which will generate a log you can play back later on another machine.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pedropgusmao picture pedropgusmao  路  3Comments

JiangPQ picture JiangPQ  路  4Comments

ebagdasa picture ebagdasa  路  5Comments

jramapuram picture jramapuram  路  6Comments

Zumbalamambo picture Zumbalamambo  路  4Comments