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

gcal_10000.typ - UnboundLocalError prevents snapshot loading #564

Closed chris-english closed 10 years ago

chris-english commented 10 years ago

Version 0.9.8 git clone From Topographica version control summary: Topographica: 8f701a7 Param: 3d1938f Imagen: a151a3f Lancet: 1c1409e Numpy: 62a7575 -V1.8.1 Dataviews isn't reported as it is imported later, just before remove_shape.

Loading a newly generated example gcal_10000.typ I get the following after selecting load snapshot in GUI, the Warning about 'legacy code' is also reported, and X'ing out the warnings, GUI reports Loading Snapshot (this may...) thereafter snapshot never loads :

topo_t000000.00_c1>>> INFO:root:Time: 000000.00 Parameterized00357: Applying legacy support for change r90800536 INFO:root:Time: 000000.00 Parameterized00358: Applying legacy support for change r90800491 INFO:root:Time: 000000.00 Parameterized00359: Applying legacy support for change r90800490 INFO:root:Time: 000000.00 Parameterized00360: Applying legacy support for change r90800486 INFO:root:Time: 000000.00 Parameterized00361: Applying legacy support for change r90800481 INFO:root:Time: 000000.00 Parameterized00362: Applying legacy support for change r90800454 INFO:root:Time: 000000.00 Parameterized00363: Applying legacy support for change r90800408 INFO:root:Time: 000000.00 Parameterized00364: Applying legacy support for change r90800407 INFO:root:Time: 000000.00 Parameterized00365: Applying legacy support for change r90800401 INFO:root:Time: 000000.00 Parameterized00366: Applying legacy support for change r90800361 INFO:root:Time: 000000.00 Parameterized00367: Applying legacy support for change r90800300 WARNING:root:Time: 000000.00 TopoConsole00325: Legacy code does not guarantee all measurement parameters have been restored. Make sure measurements are still set up correctly. INFO:root:Time: 000000.00 Parameterized00369: Applying legacy support for change r90800129 INFO:root:Time: 000000.00 Parameterized00370: Applying legacy support for change r90800126 WARNING:root:Time: 000000.00 TopoConsole00325: (UnboundLocalError) local variable 'bounds' referenced before assignment Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in call return self.func(*args) File "/home/chris/topographica/topo/tkgui/topoconsole.py", line 615, in load_snapshot topo.command.load_snapshot(snapshot_name) File "/home/chris/topographica/topo/command/init.py", line 320, in load_snapshot pickle.load(snapshot) File "/home/chris/topographica/topo/misc/legacy.py", line 153, in new_setstate state_mod_fn(instance,state) File "/home/chris/topographica/topo/misc/legacy.py", line 717, in remove_shape l, b, r, t = bounds.lbrt() UnboundLocalError: local variable 'bounds' referenced before assignment

gcal_10000.typ generated per tutorial. GUI started ./topographica -a -g, then Simulation - Load Snapshot. Same results apply to loading lissom_oo_or_10000.typ.

A word on starting GUI: ./topographica -g -> segmentation fault whereas ./topographica -a -g launches GUI as expected. Any thoughts appreciated. Chris English

jlstevens commented 10 years ago

This looks like an issue with our legacy code. We're looking into this now and shall try to get this fixed ASAP.

jlstevens commented 10 years ago

Are you sure this really is a freshly generated snapshot? I just tried the following steps without any issue with an up-to-date copy of Topographica:

As the snapshot has just been freshly created, there shouldn't be any messages about legacy fixes.

If the problem you posted above persists, it may be that Topographica has mistaken the snapshot for a much older version (which would also explain why the legacy fixes don't apply properly). Then we'll have to figure out why!

chris-english commented 10 years ago

I removed and re-installed from git. Now there are no messages about legacy fixes with a freshly generated snapshot. The snapshot loads. Model Editor displays the gcal model.