Widgets are not working.

358 views
Skip to first unread message

Neelesh Dooraree

unread,
Jan 28, 2016, 7:33:51 AM1/28/16
to Menpo Users
I have removed and installed the entire of anaconda so I could give you a clear and definite order of what I did to install.

Mac OSX
Menpo 0.6.2
Menpowidgets 0.1.1

Installed Anaconda2
Installed other Menpo Libraries http://www.menpo.org/installation/

I use PyCharm to develop, it couldn't see the libraries so I used Anaconda Cloud:

conda install -c https://conda.anaconda.org/menpo menpo

conda install -c https://conda.anaconda.org/menpo menpofit

conda install -c https://conda.anaconda.org/menpo menpo3d

conda install -c https://conda.anaconda.org/menpo menpodetect

conda install -c https://conda.anaconda.org/menpo menpowidgets



I have read that menpo does not work with IPython 4, or ipywidgets-4
I'm fairly sure anaconda cloud has installed them without me knowing.

So I have used conda install ipython=3

But when I use visualize_images(training_images) I get these errors.
I'm sure there are still IPython4 files on my computer, removing them didn't make much of a difference.
If this is still a version problem, please talk me through making the correct downgrades.

Thank you
- Neelesh

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-8220de3972f7> in <module>()
----> 1 from menpowidgets import visualize_images
      2 visualize_images(training_images)

/Users/Siren/anaconda/lib/python2.7/site-packages/menpowidgets/__init__.py in <module>()
----> 1 from .base import (visualize_pointclouds, visualize_landmarkgroups,
      2                    visualize_landmarks, visualize_images, visualize_patches,
      3                    plot_graph, save_matplotlib_figure, features_selection,
      4                    visualize_appearance_model, visualize_patch_appearance_model,
      5                    visualize_shape_model)

/Users/Siren/anaconda/lib/python2.7/site-packages/menpowidgets/base.py in <module>()
      4 import numpy as np
      5 
----> 6 import ipywidgets
      7 import IPython.display as ipydisplay
      8 

/Users/Siren/anaconda/lib/python2.7/site-packages/ipywidgets/__init__.py in <module>()
      3 from IPython import get_ipython
      4 from ._version import version_info, __version__
----> 5 from .widgets import *
      6 
      7 

/Users/Siren/anaconda/lib/python2.7/site-packages/ipywidgets/widgets/__init__.py in <module>()
----> 1 from .widget import Widget, DOMWidget, CallbackDispatcher, register, widget_serialization
      2 
      3 from .trait_types import Color, EventfulDict, EventfulList
      4 
      5 from .widget_bool import Checkbox, ToggleButton, Valid

/Users/Siren/anaconda/lib/python2.7/site-packages/ipywidgets/widgets/widget.py in <module>()
     11 
     12 from IPython.core.getipython import get_ipython
---> 13 from ipykernel.comm import Comm
     14 from traitlets.config import LoggingConfigurable
     15 from ipython_genutils.importstring import import_item

/Users/Siren/anaconda/lib/python2.7/site-packages/ipykernel/__init__.py in <module>()
      1 from ._version import version_info, __version__, kernel_protocol_version_info, kernel_protocol_version
----> 2 from .connect import *

/Users/Siren/anaconda/lib/python2.7/site-packages/ipykernel/connect.py in <module>()
     11 
     12 from IPython.core.profiledir import ProfileDir
---> 13 from IPython.paths import get_ipython_dir
     14 from ipython_genutils.path import filefind
     15 from ipython_genutils.py3compat import str_to_bytes

ImportError: No module named paths

Message has been deleted

mr.ko...@gmail.com

unread,
Jan 29, 2016, 4:38:34 AM1/29/16
to Menpo Users
Hi,

just a quick addition with a simular issue: in the Python 2.7 version, there are no notebooks for menpofit 0.3.1 and using the still available 0.3.0 notebooks also results in broken widgets. calling visualize_images(training_images) from the notebook gives this:



Initializing...

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-da49d708fba9> in <module>()
1 from menpowidgets import visualize_images
2
----> 3 visualize_images(training_images)

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\menpowidgets\base.py in visualize_images(images, figure_size, style, browser_style)
804 group_keys=groups_keys, labels_keys=labels_keys,
805 render_function=render_function, style=landmarks_style,
--> 806 renderer_widget=renderer_options_wid)
807 info_wid = TextPrintWidget(n_lines=1, text_per_line=[''],
808 style=info_style)

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\menpowidgets\options.py in __init__(self, group_keys, labels_keys, render_function, renderer_widget, style)
1110
1111 # Set values
-> 1112 self.set_widget_state(group_keys, labels_keys, allow_callback=False)
1113
1114 # Set style

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\menpowidgets\options.py in set_widget_state(self, group_keys, labels_keys, allow_callback)
1392 render_function = self._render_function
1393 self.remove_render_function()
-> 1394 self.remove_callbacks()
1395
1396 # Assign properties

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\menpowidgets\options.py in remove_callbacks(self)
1125 self._render_landmarks_fun, 'value', remove=True)
1126 self.group_dropdown.on_trait_change(self._group_fun, 'value',
-> 1127 remove=True)
1128 self._remove_function_from_labels_toggles(self._labels_fun)
1129

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\traitlets\traitlets.pyc in on_trait_change(self, handler, name, remove)
1138 name = All
1139 if remove:
-> 1140 self.unobserve(_callback_wrapper(handler), names=name)
1141 else:
1142 self.observe(_callback_wrapper(handler), names=name)

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\traitlets\traitlets.pyc in unobserve(self, handler, names, type)
1191 names = parse_notifier_name(names)
1192 for n in names:
-> 1193 self._remove_notifiers(handler, n, type)
1194
1195 def unobserve_all(self, name=All):

C:\Miniconda\envs\menpo_0_3_0\lib\site-packages\traitlets\traitlets.pyc in _remove_notifiers(self, handler, name, type)
1101 del self._trait_notifiers[name][type]
1102 else:
-> 1103 self._trait_notifiers[name][type].remove(handler)
1104 except KeyError:
1105 pass

ValueError: list.remove(x): x not in list

Neelesh Dooraree

unread,
Jan 29, 2016, 7:20:29 AM1/29/16
to Menpo Users, mr.ko...@gmail.com
I also go this same error on a separate occasion.

At the moment I am making due with the 'browse_images' method is this notebook http://nbviewer.jupyter.org/github/menpo/menpo-notebooks/blob/v0.3.0/notebooks/Deformable%20Models/AAMs%20Basics.ipynb

But it is only showing me landmarks, not the images.

These widget problems need to be addressed, I am not the only person struggling.

- Neelesh

patricksnape

unread,
Jan 29, 2016, 9:51:51 AM1/29/16
to Menpo Users, mr.ko...@gmail.com
@Neelesh
Sorry to hear you are having issues! I'm sure we can work them out between us. You said:

I have read that menpo does not work with IPython 4, or ipywidgets-4
I'm fairly sure anaconda cloud has installed them without me knowing.

I'm not sure what you mean? Can you tell me where you got that information because I want to remove it, as it is not correct! The whole point of the conda build recipes is that installation is handled explicitly and all versions are hard-defined to be correct. Ergo, assuming that the projects we rely on respect the semver process, we should never having breaking changes for our recipes. Therefore, please remove IPython and Jupyter and menpowidgets and then reinstall  menpowidgets (which should successfully upgrade your Jupyter to the correct version - the latest 4.*). Also, do not use the browse_images method - as that was designed for IPython from a few versions ago and therefore is unlikely to work. Please use the latest version of Menpo so that we are all on the same page.

@Neelesh and @mr.kopaczka
Unfortunately, despite what I said above, the traitlets package has made a minor version bump - but made a breaking change! This is the cause of the
ValueError: list.remove(x): x not in list
error that you have both seen. Therefore, you have two options for now:
  1. Ensure that you have traitlets 4.0.0 installed (downgrade from 4.1.0)
  2. Upgrade menpowidgets once v0.1.2 is release - which contains a fix for this change in traitlets 4.1.0 (https://github.com/menpo/menpowidgets/pull/7)
At the moment I'm experiencing a weird bug on our Windows build server - which I am investigating and hopefully the new menpowidgets will be out by the end of the day!

If you have any other issues, or anything is unclear, please don't hesitate to reply.

Patrick

Neelesh Dooraree

unread,
Jan 29, 2016, 11:03:41 AM1/29/16
to Menpo Users, mr.ko...@gmail.com
Hi Patrick,

I have realised that menpo 0.6.2 actually NEEDS jupiter.
However I have noticed menpo works best if you have had the previous versions, and upgrade (on OSX)
But it's clearly outdated. I apologies for this confusion!

I have another visualisation issue, with 'image.view_widget()', here is a pastebin of the error

I will downgrade traitlets to 4.0.0 and experiment some more.

- Neelesh

patricksnape

unread,
Jan 29, 2016, 11:22:15 AM1/29/16
to Menpo Users, mr.ko...@gmail.com
Hi Neelesh,

Yes, that error is one of the errors caused by the traitlets bug - I'm still struggling with our builds but downgrading should fix your problem.

Let me know if it doesn't!

Patrick

Neelesh Dooraree

unread,
Jan 29, 2016, 11:35:36 AM1/29/16
to Menpo Users, mr.ko...@gmail.com
Hey Patrick!

visualize_images(training_images) and image.view_widget() are now working!

If anyone else experiences widget problems, this is the terminal command for downgrading traitlets: conda install traitlets=4.0.0

patricksnape

unread,
Jan 29, 2016, 2:18:08 PM1/29/16
to Menpo Users, mr.ko...@gmail.com
Hi Neelesh,

Try upgrading menpowidgets now (menpowidgets 0.1.2). This should work with traitlets 4.1.0 and 4.0.0.

Cheers,

Patrick
Reply all
Reply to author
Forward
0 new messages