AttributeError: 'Plot' object has no attribute 'channels'
Posted in General by Kasirat Tue Apr 19 2016 04:43:26 GMT+0000 (Coordinated Universal Time)·8·Viewed 6,303 times
I am new to OpenDeep, trying out the example code for monitoring channels, copy and pasted the code from the example page, but shows this error : Plot object has no attribute 'channel'. Can anyone please help. Thanks
Hi Kasirat! Sure thing, what version and branch are you using with OpenDeep? The Plot object is defined here: https://github.com/vitruvianscience/OpenDeep/blob/master/opendeep/monitor/plot.py
I just edited some typos in the last script of the monitor tutorial here:
http://www.opendeep.org/docs/monitors-and-live-plotting
Does the new version work?
Hi Markus, Thanks for the response. I have only just installed OpenDeep and updated all the other libraries just yesterday. I am not sure what I am missing here. When I run the monitor tutorial script on Jupyter, I get down to the same error:
#
--> 290 if monitor_channels is None and plot is not None and len(plot.channels) > 0:
291 monitor_channels = plot.channels
292 self.train_monitors_dict = {}
AttributeError: 'Plot' object has no attribute 'channels'
. But when running using the command prompt it does say that : No handlers could be found for logger "opendeep.utils.control.conv1d_implementations"
Hmmm confusing error. Plot has 'self.channels = monitor_channels' in the init method. Potentially you don't have Bokeh pip installed? Because that part of Plot.init isn't called unless it finds Bokeh's imports. Here is the file:
https://github.com/vitruvianscience/OpenDeep/blob/master/opendeep/monitor/plot.py
Can you see what the variable BOKEH_AVAILABLE is?
You can see it with this code:
third party libraries
try:
from bokeh.client import push_session
from bokeh.plotting import (curdoc, output_server, figure)
from bokeh.models.renderers import GlyphRenderer
logging.getLogger("bokeh").setLevel(logging.INFO) # only log info and up priority for bokeh
logging.getLogger("urllib3").setLevel(logging.INFO) # only log info and up priority for urllib3
BOKEH_AVAILABLE = True
except ImportError:
BOKEH_AVAILABLE = False
warnings.warn("Bokeh is not available - plotting is disabled. Please pip install bokeh to use Plot.")
Markdown made some things bold and headers, sorry about that.
No worries! (about the bold and headers!)
Apparently I can not import any bokeh. But I have bokeh i installed it using Anaconda : conda install bokeh.
Which parts of Bokeh aren't importing? Maybe anaconda's version is outdated from the pip version - I know they changed a lot recently which made me rewrite Plot.
Were you able to get it working by pip installing Bokeh?
Hi, Thanks for asking and sorry for the late response. I have not been able to get it to work. For the time being I will hold it off. But will get back to it soon. :)