Scikit 0.3 AttributeError

134 views
Skip to first unread message

Emmy Guy

unread,
Sep 22, 2017, 2:27:29 PM9/22/17
to scikit-fuzzy
Hi

I am relatively new to this API; I find it cool anyway(kudos team scikit). I want to implement a fuzzy controller for a autonomous robot simulation on VREP controlled from Spyder (python 2.7) but in get these errors when implementing the 'Tipping examples'.

i. rule1.view() gives:
Traceback (most recent call last):

 Traceback (most recent call last):

  File "<ipython-input-4-3c5b2551db94>", line 1, in <module>
    runfile('C:/Python27/Lib/site-packages/skfuzzy/control/tipping.py', wdir='C:/Python27/Lib/site-packages/skfuzzy/control')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Python27/Lib/site-packages/skfuzzy/control/tipping.py", line 39, in <module>
    rule1.view()

  File "C:\Python27\lib\site-packages\skfuzzy\control\rule.py", line 247, in view
    ControlSystemVisualizer(self).view().show()

AttributeError: 'tuple' object has no attribute 'show'


ii. tipping_ctrl = ctrl.ControlSystem([rule1, rule2, rule3]) gives:
Traceback (most recent call last):

  File "<ipython-input-5-3c5b2551db94>", line 1, in <module>
    runfile('C:/Python27/Lib/site-packages/skfuzzy/control/tipping.py', wdir='C:/Python27/Lib/site-packages/skfuzzy/control')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Python27/Lib/site-packages/skfuzzy/control/tipping.py", line 41, in <module>
    tipping_ctrl = ctrl.ControlSystem([rule1, rule2, rule3])

  File "C:\Python27\lib\site-packages\skfuzzy\control\controlsystem.py", line 45, in __init__
    self.addrule(rule)

  File "C:\Python27\lib\site-packages\skfuzzy\control\controlsystem.py", line 98, in addrule
    for r in self.rules:

  File "C:\Python27\lib\site-packages\skfuzzy\control\controlsystem.py", line 596, in __iter__
    self._cache = list(self._process_rules(self.all_rules[:]))

  File "C:\Python27\lib\site-packages\skfuzzy\control\controlsystem.py", line 630, in _process_rules
    if self._can_calc_rule(rule):

  File "C:\Python27\lib\site-packages\skfuzzy\control\controlsystem.py", line 658, in _can_calc_rule
    for p in self.all_graph.predecessors_iter(rule):

AttributeError: 'DiGraph' object has no attribute 'predecessors_iter'

P.S.: i used
 pip install -U scikit-fuzzy for the installation

thanks

Joshua Warner

unread,
Sep 22, 2017, 2:40:29 PM9/22/17
to Emmy Guy, scikit-fuzzy
The first issue is fixed in master, you can safely ignore it and proceed.  If you need to visualze the Rule, you can use the development version or wait; this and another recent fix will be packaged into a minor point bugfix release soon.

The second looks like a real bug, related to NetworkX.  Can you check which version of NetworkX are you using, and open a new Issue on the project GitHub page for this?

Emmy Guy

unread,
Sep 25, 2017, 5:39:02 AM9/25/17
to scikit-fuzzy
Hello Josh

thanks for the earnest reply and sorry for the delay in response.
I have opened an issue on Github as you suggested; also, the version of networkx am using is networkx-2.0. i did run an update but the error still persists.

thanks.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages