ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

AttributeError: cos #613

Open ceball opened 9 years ago

ceball commented 9 years ago

From Jan, in #611.


Hello everybody,

just an update on the current situation. I just did a completely fresh install of Ubuntu 14. I installed the ubuntu tk and pil packages. Under this installation method I do not get anymore the problems with the GUI. Unfortunately I now get this other bug which I remember seeing once very long time ago, but I cannot remember how it was resolved. I am attaching it below in case somebody has seen that recently.

I also tried to install topographica within a virtualenv, with all the related packages installed from pip instead. This unfortunately did not worked (yet) as I cannot make PIL recognize tkinter - it complains that the tcl/tk libraries are not installed on the system even though they were.

Best, Jan

The current bug:

WARNING:root:Time: 000002.05 TopoConsole00345: (AttributeError) cos
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
    return self.func(*args)
  File "/home/jan/projects/topographica-new/topo/tkgui/topoconsole.py",
line 735, in run_simulation
    topo.sim.run_and_time(fduration)
  File "/home/jan/projects/topographica-new/topo/base/simulation.py", line
1235, in run_and_time
    self.timer.call_and_time(duration)
  File "/home/jan/projects/topographica-new/topo/base/simulation.py", line
740, in call_and_time
    self.__measure(fduration,step)
  File "/home/jan/projects/topographica-new/topo/base/simulation.py", line
692, in __measure
    self.func(arg_list[i])
  File "/home/jan/projects/topographica-new/topo/base/simulation.py", line
1347, in run
    event(self)
  File "/home/jan/projects/topographica-new/topo/base/simulation.py", line
522, in __call__
    self.fn(*self.args,**self.kw)
  File "/home/jan/projects/topographica-new/topo/base/generatorsheet.py",
line 104, in generate
    ac = self.input_generator()
  File "./contrib/complex_cell_lissom.ty", line 145, in __call__
    return generator(xdensity=xdensity, ydensity=ydensity, bounds=bounds,
x=self.x + self.jitter_magnitude * self.r(), y=self.y +
self.jitter_magnitude * self.r(),
orientation=self.inspect_value("orientation"),
index=self.inspect_value("index"))
  File
"/home/jan/projects/topographica-new/external/imagen/imagen/patterngenerator.py",
line 148, in __call__
    self._setup_xy(p.bounds,p.xdensity,p.ydensity,p.x,p.y,p.orientation)
  File
"/home/jan/projects/topographica-new/external/imagen/imagen/patterngenerator.py",
line 211, in _setup_xy
    self.pattern_x, self.pattern_y =
self._create_and_rotate_coordinate_arrays(x_points-x,y_points-y,orientation)
  File
"/home/jan/projects/topographica-new/external/imagen/imagen/patterngenerator.py",
line 238, in _create_and_rotate_coordinate_arrays
    pattern_y = np.subtract.outer(np.cos(orientation)*y,
np.sin(orientation)*x)
AttributeError: cos

Reply by Jean-Luc:

@antolikjan Are you using the --system-site-packages option when creating your virtualenv? Something like:

virtualenv --system-site-packages topo

As I use virtualenvwrapper, I be would using something like this instead:

mkvirtualenv --system-site-packages topo

This should expose all the functionality available on your system by default while also giving you control over where any new packages go. In addition, you can shadow the system packages with different versions if you need.

ceball commented 9 years ago

On Ubuntu 14.04.1, the latest git version of topographica seems to work fine for me. The problem of topoconsole not expanding is fixed by one of the workarounds in #611 (e.g. having a matplotlibrc file in the topographica directory with backend: agg in it).