Code Monkey home page Code Monkey logo

visdom's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visdom's Issues

Error when running demo.py

When I run demo.py I get the following error:

Traceback (most recent call last):
  File "visdom/example/demo.py", line 232, in <module>
    viz.mesh(X=X, Y=Y, opts=dict(opacity=0.5))
AttributeError: 'Visdom' object has no attribute 'mesh'

What's the problem?

[JSON file] Figure title saved in content field rather than title field

Title field in saved json file is not getting populated
Sample Code :

v = visdom.Visdom()
v.line(np.random.randn(100),opt=dict(title='sample_title'), env = 'sample_env')
v.save(['sample_env'])

with open('~/.visdom/sample_env','r') as f:
    json_data = json.load(f)
assert json_data['jsons'].values()[0]['title'] ==  ''    #True

Edit - I found the figure title buried in the content field. Is this to be expected? If so, what is the title field for?

json_data['jsons'].values()[0]['content']['layout']['title'] == 'sample_title'

Bug in PIL when using vis.image in Python?

when i run:

import visdom
import numpy as np
vis = visdom.Visdom()
vis.text('Hello, world!')
vis.image(np.ones((10, 10, 3)))

i got:

In [29]: import visdom
    ...: import numpy as np
    ...: vis = visdom.Visdom()
    ...: vis.text('Hello, world!')
    ...: vis.image(np.ones((10, 10, 3)))
    ...:
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/Users/zyuan/anaconda/lib/python3.5/site-packages/PIL/Image.py in fromarray(obj, mode)
   2194             typekey = (1, 1) + shape[2:], arr['typestr']
-> 2195             mode, rawmode = _fromarray_typemap[typekey]
   2196         except KeyError:

KeyError: ((1, 1, 10), '|u1')

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-29-94aa5cfce374> in <module>()
      3 vis = visdom.Visdom()
      4 vis.text('Hello, world!')
----> 5 vis.image(np.ones((10, 10, 3)))

/Users/zyuan/anaconda/lib/python3.5/site-packages/visdom/__init__.py in image(self, img, win, env, opts)
    307
    308         img = np.transpose(img, (1, 2, 0))
--> 309         im = Image.fromarray(img)
    310         buf = BytesIO()
    311         im.save(buf, format='JPEG', quality=opts['jpgquality'])

/Users/zyuan/anaconda/lib/python3.5/site-packages/PIL/Image.py in fromarray(obj, mode)
   2196         except KeyError:
   2197             # print(typekey)
-> 2198             raise TypeError("Cannot handle this data type")
   2199     else:
   2200         rawmode = mode

TypeError: Cannot handle this data type

Python example works but not lua

installed as required but found lua examples are not working

| visdom http request failed: host or service not provided, or not known
| visdom http request failed: host or service not provided, or not known
| visdom http request failed: host or service not provided, or not known
| visdom http request failed: host or service not provided, or not known
...

But python code works fine and can see in port 8097.

Feature Request: Subfolder/project support

Hello,

I really like this project and have started to use it with multiple projects. However, this can quickly lead to a drop-downs with a considerable number of different environments from different projects. A colleague and myself have started a slightly hacky approach in implement subfolder support which works for viewing and loading files from different subfolders. Before we continue implementing support for saving into subfolders we thought we ask if something like this already exists or is under development?

Currently we created a second drop down that allows the selection of folders as well as linking that back to server.py to change the PATH in which the server is looking for JSON files.

For me this seems to be a critical feature when used with multiple people/projects so I would be curious to hear what solutions other people have found. I guess another one could be to start different visdom servers for each project with different ports?

Best wishes,
Florian

Line update doesn't update in some cases

Something strange happens when I try to update a line plot with several lines. It just does not update in some cases, I created a minimal example:

Y = numpy.array([[numpy.nan, numpy.nan], [2., numpy.nan]])
X = numpy.array([[0., 0.], [1., 1.]])
window = viz.line(Y, X, opts=dict(legend=['a', 'b']))

Y = numpy.array([[3., numpy.nan]])
X = numpy.array([[2., 2.]])
viz.line(Y, X, update='append', win=window)

It produces only a single point at (1, 2):
screen shot 2017-03-23 at 1 11 50 pm

I had to use NaNs to mitigate the issue #31.

Mokeypatching visdom

Hi,

I'm trying to patch visdom to take in a name variable on instantiation, but I keep getting an error. This is probably a stupid question, but what is the proper way to do this?

class Dashboard(Visdom):
    def __init_(self, name):
        super(Dashboard, self).__init__()
        self.env = name
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/visdom/__init__.py", line 220, in _send
    data=json.dumps(msg),
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/requests/api.py", line 110, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/requests/sessions.py", line 603, in send
    adapter = self.get_adapter(url=request.url)
  File "/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/requests/sessions.py", line 685, in get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for 'seq-to-seq-experiment:8097/events'

Cannot save the environment if it contains slashes

Hi, thank you for the great software first!

I am really enjoying using the software, however I found some trivial bugs that occur in corner cases.
When I try to save an environment which contains slashes, for example "model_1/dim100", it cannot save the environment and makes some unhappy side effects.
If I save it programmatically, for example vis.save([env_name]), the server makes error logs of FileNotFoundError, since the directory $HOME/.visdom/model_1 does not exist.
And if I try to save it on the webpage, the webpage goes offline and I have to click the "offline" button or refresh the page to revive functionalities.

I think two solutions are possible:

  1. making the directory (using something like mkdir -p or os.makedirs) before making the JSON file of an environment, or
  2. replacing slash characters with other safe characters, like _.

how to remove an env from drop down menu?

First thanks for the team for the great tool!

I've tried deleting the json file from ~/.visdom/, but the env name still shows in the drop down menu. I also tried hard refresh the page cache (i am using chrome), but still no luck. Any clues? Thanks!

HTTPConnectionPool for python

When I try

import visdom
import numpy as np
vis = visdom.Visdom()
vis.text('Hello, world!')
vis.image(np.ones((10, 10, 3)))

I got this:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/visdom/__init__.py", line 170, in _send
    data=msg
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 110, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /events (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fa5b40f3690>: Failed to establish a new connection: [Errno 111] Connection refused',))

Actually the first time I launched the web successfully. But after that it cannot work anymore even I restart the computer.

TypeError: Bytes instead of String.... No plot

Hi,

I am trying to use Visdom with python 3.5. Each time I try to plot something, I obtain the following error (on, the server side ):

Traceback (most recent call last):
  File "/home/denoyer/anaconda3/lib/python3.5/site-packages/tornado/web.py", line 1467, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/denoyer/anaconda3/lib/python3.5/site-packages/visdom/server.py", line 227, in post
    args = json.loads(self.request.body)
  File "/home/denoyer/anaconda3/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
ERROR:root:ERROR: 500: {'exc_info': (<class 'TypeError'>, TypeError("the JSON object must be str, not 'bytes'",), <traceback object at 0x7f7830e32888>)}
ERROR:tornado.access:500 POST /events (127.0.0.1) 2.10ms

Moreover, when plotting image, I have the error TypeError: string argument expected, got 'bytes'on the client side -- I suppose it is a problem with the filename (line 479 in _save, file ImageFile.py)

Programatically create an env

In the docs it's said that it's possible to programatically create envs. However, I haven't been able to find an example of this in the python example, nor did it become evident after checking the source code.
Could anyone give a hint?

Feature request: Formatting for text()

Currently, there does not seem to be a way of getting line breaks in text boxes (?).

More generally, it would be great if text boxes would support formatting rather than interpreting the content as text/plain -- to get text in bold or italic, lists, et cetera. Possibly, a quick and flexible solution would be to interpret the content as html.

Independently add two lines to plot

I am trying to send data to a line plot from two different processes, each of which is responsible for a single line. Currently I do this by keeping in memory the last point for each line so that when data comes for one line I can redundantly overwrite the last point assigned to the other.
While this works (with limitations), I'd like to implement a method that allows me to update a line in a plot independently any other possible lines in the plot.
Is something like this possible with the current version of the library?

Feature requests: default env and let win to be set from the start

Hello, first thank you for maintaining this project, it is wonderful (and did not fail for me so far).

  1. Now you must specify env for each visualization you create. But I assume a lot of people use only one env per script (for example each env corresponds to an experiment and you plot a lot of things for it). So I would love to set env once and then pass viz object wherever I want (now I also need to pass env along with viz if I want to create visualization inside a function or package). I am not sure what is the best way to implement it though, so submitting issue instead of pull request.

  2. In display one could specify win for every plot, e.g. always plot loss in the first, show samples in the second. Now every time I rerun experiment new windows are created and I need to close old ones manually.

Stem plot doesn't show (on python)

Hi all and thanks for the great work on this library.
I am still getting familiarized with the API using the Python demo code, but I am having problem getting the stem plot to work.
I am using the exact code from demo.py:

# stemplot
Y = np.linspace(0, 2 * math.pi, 70)
X = np.column_stack((np.sin(Y), np.cos(Y)))
viz.stem(
    X=X,
    Y=Y,
    opts=dict(legend=['Sine', 'Cosine'])
)

But nothing shows up on the client. There is no output error either (running on iPython the result from running that black is u'pane_34ecea25d1... so it seems to be correctly creating a pane, but it's just not showing.
(I am running Python 2.7.12 btw)

Issue in visualizing array of Gaussian random numbers

I'm trying to visualize samples drawn from a gaussian distribution but facing issues. Specifically it throws the error: Cannot write mode LA as JPEG. Below is the complete traceback.

In [18]: gauss
Out[18]: 
array([[[ 0.91407453,  0.46979484],
        [-0.42512565, -0.03939989],
        [-0.58292992, -0.96786686]],

       [[ 0.22980538,  0.45313612],
        [-0.80436446, -0.87064141],
        [-0.13678825, -0.4125797 ]]])

In [19]: vis.image(gauss)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/home/mario/anaconda3/lib/python3.5/site-packages/PIL/JpegImagePlugin.py in _save(im, fp, filename)
    589     try:
--> 590         rawmode = RAWMODE[im.mode]
    591     except KeyError:

KeyError: 'LA'

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-19-0d73084d7164> in <module>()
----> 1 vis.image(gauss)

/home/mario/anaconda3/lib/python3.5/site-packages/visdom/__init__.py in result(*args, **kwargs)
    177                 kwargs[k] = kwargs[k].cpu().numpy()
    178 
--> 179         return fn(*args, **kwargs)
    180     return result
    181 

/home/mario/anaconda3/lib/python3.5/site-packages/visdom/__init__.py in image(self, img, win, env, opts)
    317         im = Image.fromarray(img)
    318         buf = BytesIO()
--> 319         im.save(buf, format='JPEG', quality=opts['jpgquality'])
    320         b64encoded = b64.b64encode(buf.getvalue()).decode('utf-8')
    321 

/home/mario/anaconda3/lib/python3.5/site-packages/PIL/Image.py in save(self, fp, format, **params)
   1726 
   1727         try:
-> 1728             save_handler(self, fp, filename)
   1729         finally:
   1730             # do what we can to clean up

/home/mario/anaconda3/lib/python3.5/site-packages/PIL/JpegImagePlugin.py in _save(im, fp, filename)
    590         rawmode = RAWMODE[im.mode]
    591     except KeyError:
--> 592         raise IOError("cannot write mode %s as JPEG" % im.mode)
    593 
    594     if im.mode == 'RGBA':

OSError: cannot write mode LA as JPEG

Any ideas or insights about how to resolve this issue?

Update README

The readme does not have any details on how to use updateTrace or update linegraphs.

Any help into this is appreciated.

Append on Visdom.line expect different data format

Thanks again for the great library.
I was trying the python example code, and it seems to me there's a problem with the input data format in the following block:

# line updates
win = viz.line(
    X=np.column_stack((np.arange(0, 10), np.arange(0, 10))),
    Y=np.column_stack((np.linspace(5, 10, 10), np.linspace(5, 10, 10) + 5)),
)
viz.line(
    X=np.column_stack((np.arange(10, 20), np.arange(10, 20))),
    Y=np.column_stack((np.linspace(5, 10, 10), np.linspace(5, 10, 10))),
    win=win,
    update='append'
)

When creating the line plot, the two series of data are stacked as columns, such as every Nth row of X contains Nth value of all the series.
But using the same format for updating the plot (with `update='append') doesn't work. The plot doesn't get updated as expected.
It is necessary to stack the two series as rows using something like below (or by stacking them in columns then transposing them):

viz.line(
    X=np.row_stack((np.arange(10, 20), np.arange(10, 20))),
    Y=np.row_stack((np.linspace(5, 10, 10), np.linspace(5, 10, 10))),
    win=win,
    update='append'
)

Doing this updates each series by appending the new points as expected.

I think the reason is that when creating a line plot initially, the following line ravels the data series in Fortran-style order:
https://github.com/facebookresearch/visdom/blob/master/py/init.py#L453

rownames/column names automatically removing identical items in list

Hi,

I was wondering if there is anyway to allow the labels on the xaxis or yaxis (column names or rownames) to show duplicated items. I am trying to visualize a sentence via the heatmap and all my pad tokens are converted to a single pad token which changes the alignment.

Thanks!

Specify individual colors/styles for different lines in same plot

For example, say I've got data like this:

     TrainLossDataset1
     ValidationLossDataset1
     TrainLossDataset2
     ValidationLossDataset2

and I want to plot them on the same axes, but with interpretable styles/colors, e.g. these:

    TrainLossDataset1       -> red with circular markers 
    ValidationLossDataset1  -> red with triangular markers 
    TrainLossDataset2       -> blue with circular markers
    ValidationLossDataset1  -> blue with triangular markers 

Is such a thing possible? So far, I am only able to specify styles for all the lines in a plot at once. Thanks!

update='append' add line

I have this two lines:
ema1
ema2

I try to plot them together with:

win = vis.line(ema_1, np.arange(size_time))
vis.line(ema_2, np.arange(size_time), win=win,update='append')

And I get this plot:
ema3

There is the two curves I expected and one more.
Did I something wrong?

Thanks

Feature Request: Grid of multiple images

It is often useful to plot multiple images in a grid, for comparison need. It shall be very good if Visdom adds this functionality, e.g. PyTorch has this make_grid function which is nice. Hopefully it can be improved a bit and integrated into Visdom.

Problems executing example code

Hi,

thanks for a really cool-looking library!

I'm having trouble running the demo code, using an Anaconda distribution of Python 3.5 on macOS Sierra. I installed Visdom using "pip install visdom".

Here's the example code from your README:

import visdom
import numpy as np
vis = visdom.Visdom()
vis.text('Hello, world!')
vis.image(np.ones((10, 10, 3)))

When the vis.text call is executed, the following error message appears in the "python -m visdom.server" process:

ERROR:tornado.application:Uncaught exception POST /events (::1)
HTTPServerRequest(protocol='http', host='localhost:8097', method='POST', uri='/events', version='HTTP/1.1', remote_ip='::1', headers={'User-Agent': 'python-requests/2.9.1', 'Host': 'localhost:8097', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '97', 'Accept-Encoding': 'gzip, deflate'})
Traceback (most recent call last):
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/visdom/server.py", line 227, in post
    args = json.loads(self.request.body)
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
ERROR:root:ERROR: 500: {'exc_info': (<class 'TypeError'>, TypeError("the JSON object must be str, not 'bytes'",), <traceback object at 0x10919db88>)}
ERROR:tornado.access:500 POST /events (::1) 2.66ms

Nothing appears in the browser window. Then, when I try to execute the vis.image call, this call throws the following exception on the client side. The same exception happens if I don't call vis.text before, so perhaps these are two unrelated issues?

Traceback (most recent call last):
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/PIL/ImageFile.py", line 461, in _save
    fh = fp.fileno()
io.UnsupportedOperation: fileno

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/visdom/__init__.py", line 241, in image
    im.save(buf, format='JPEG', quality=opts['jpgquality'])
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/PIL/Image.py", line 1728, in save
    save_handler(self, fp, filename)
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/PIL/JpegImagePlugin.py", line 734, in _save
    ImageFile._save(im, fp, [("jpeg", (0, 0)+im.size, 0, rawmode)], bufsize)
  File "/Users/koller/anaconda/envs/py35/lib/python3.5/site-packages/PIL/ImageFile.py", line 476, in _save
    fp.write(d)
TypeError: string argument expected, got 'bytes'

No further error message appears on the server side.

Any thoughts on what might be causing this?

Best,
Alexander.

CV2 Version 3 support

I got this error running demo.py. Perhaps explain somewhere that its not compatible with the latest version of cv2?
http://stackoverflow.com/questions/15584608/python-opencv2-cv2-cv-fourcc-not-working-with-videowriter

bfortuner@bfortuner-MS-7A71:~/workplace/ml-study$ python visdom_demo.py
Traceback (most recent call last):
File "visdom_demo.py", line 16, in
viz.video(tensor=video)
File "/home/bfortuner/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 346, in video
fourcc = cv2.cv.CV_FOURCC(
AttributeError: module 'cv2.cv2' has no attribute 'cv'

import cv2
cv2.version
'3.2.0'

line update="append" error

When put in this get an error

trace_id = vis.line(
    np.arange(100), 
    np.random.rand((100)),
    update = "append"
)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-40-4eb184488c36> in <module>()
      5     np.arange(100),
      6     np.random.rand((100)),
----> 7     update = "append"
      8 )

/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/visdom/__init__.py in result(*args, **kwargs)
    169                 kwargs[k] = kwargs[k].cpu().numpy()
    170 
--> 171         return fn(*args, **kwargs)
    172     return result
    173 

/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/visdom/__init__.py in line(self, Y, X, win, env, opts, update)
    539             assert X is not None, 'must specify x-values for line update'
    540             return self.updateTrace(X=X, Y=Y, win=win, env=env,
--> 541                                     append=update == 'append', opts=opts)
    542         assert Y.ndim == 1 or Y.ndim == 2, 'Y should have 1 or 2 dim'
    543 

/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/visdom/__init__.py in result(*args, **kwargs)
    169                 kwargs[k] = kwargs[k].cpu().numpy()
    170 
--> 171         return fn(*args, **kwargs)
    172     return result
    173 

/home/user/anaconda3/envs/deep-learning/lib/python3.6/site-packages/visdom/__init__.py in updateTrace(self, X, Y, win, env, name, append, opts)
    395         specified plot.
    396         """
--> 397         assert win is not None
    398 
    399         assert Y.shape == X.shape, 'Y should be same size as X'

AssertionError: 

Feature request: Plugin Templates

I was thinking something that could be useful would be to expose an API that allowed contributors to easily build custom plotting functions.

I could imagine many common use cases where you take some data input, and let the plugin seamlessly transform it into a graph. As an example, imagine a plugin that simply takes predictions and class labels and pushes live updates to an ROC curve after every model iteration. The more complex the chart, the more handy a pluggable template would be.

Feature Request: Improved line plotting functions with interactive smoothing

I think it would be good if it could support better line plotting like with tensorboards writer.add_summary summary.scalar:

  1. append single data points at a time
  2. interactive smoothing slider for line plots ( e.g. with https://plot.ly/python/slider-widget/ )
  3. transparent view of non-smoothed data
  4. error envelopes ( https://plot.ly/python/continuous-error-bars )
  5. logging of relative/wall time simultaneous to global steps in x-axis

`opts` vs. `options`

The true name of the options dictionary is opts but it is referred to as options in the Readme.

error running python example/demo.py

Traceback (most recent call last):
  File "example/demo.py", line 27, in <module>
    viz.video(tensor=video)
  File "/home/jcc/anaconda2/lib/python2.7/site-packages/visdom/__init__.py", line 358, in video
    assert writer.isOpened(), 'video writer could not be opened'
AssertionError: video writer could not be opened

bugs fixed for updateTrace in init.lua

return self:sendRequest{ request = ({ data = nan2null(data), win = win, eid = env, name = name, append = append, }), endpoint = 'update', }
should be
return self:sendRequest( { data = nan2null(data), win = win, eid = env, name = name, append = append, }, 'update' )

Is there near plan to add more documents?

Great tools!
and I have several questions.
how to create different visdom workspace programmingly?
Is it possible to make the following code work if the window 'loss' has not been initiated before. It's quite inconvenient if I have to create every window first using some dammy data and then update it.

viz.line(
    X = np.asarray([0]),
    Y= np.array([10]),
    win='loss',
    update='append'
)

Thank you~

Issue with pip install -e .

When I try to install visdom for local development, I get the following error when running example/demo.py:

Traceback (most recent call last):
  File "demo.py", line 12, in <module>
    from visdom import Visdom
ModuleNotFoundError: No module named 'visdom'

When I rename the directory py to visdom, this error goes away.

AssertionError: Y should be same size as X

I want to dynamically update (x,y)
I used the codes below:

win = viz.line(
    X=np.column_stack((np.arange(0, 2), np.arange(0, 2))),
    Y=np.column_stack((np.linspace(5, 10, 2), np.linspace(5, 10,2) + 5)),
)

viz.updateTrace(
    X=np.arange(3, 4),
    Y=np.arange(10, 15),
    win=win,
    name='2'
)

but why it always gives me this error:
assert Y.shape == X.shape, 'Y should be same size as X'
AssertionError: Y should be same size as X
and once I set

viz.updateTrace(
    X=np.arange(3, 4),
    Y=np.arange(10, 11),
    win=win,
    name='2'
)

there is no error.
So how to plot (0,1) --> (1,10) -->(2,15) ??
Why must 11-10 == 4-3 ?

Feature Request: update text pane

Hi,
sometimes it's useful to send some textual data from the model in regular intervals. As far as I understand, right now we can only replace text in the window with something new, but we cannot append.

I can easily monkey-patch it by adding the following to UpdateHandler and modifying css to display newlines, but I don't know how to do this properly.

def update(self, p, args):
    if isstr(p['content']):
        p['content'] += "\r\n" + args['data'][0]['content']
        return p

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.