Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'module' object has no attribute 'maximum' #694

Open
dancehours opened this issue Feb 19, 2019 · 8 comments
Open

AttributeError: 'module' object has no attribute 'maximum' #694

dancehours opened this issue Feb 19, 2019 · 8 comments

Comments

@dancehours
Copy link

Hi, I get a error from running topographica jobs,

Traceback (most recent call last):
File "/scratch01/env_c/topographica_pbc/pbc_measurement.py", line 90, in
load_snapshot(path+fname+'/'+snapshot_name)
File "/scratch01/env_c/topographica_pbc/topo/command/init.py", line 325, in load_snapshot
pickle.load(snapshot)
AttributeError: 'module' object has no attribute 'maximum'

Before it worked well, suddenly this error appears, I have no idea how to solve it.

@jbednar
Copy link
Member

jbednar commented Feb 19, 2019

This error seems to indicate that when you saved the snapshot last time, some code of yours previously defined an attribute named maximum, but that attribute is no longer defined in your code so that pickle is failing when it tries to restore that attribute. If maximum isn't important, you can probably put in a dummy declaration for it so that the pickle loading no longer fails, but there may be other changes needed.

@dancehours
Copy link
Author

dancehours commented Feb 19, 2019 via email

@dancehours
Copy link
Author

Hi, I would need to make a diagram of the gcal model. I found I can referred to the model view showed
in the second image from this link http://ioam.github.io/topographica/Tutorials/gcal.html. I have
a difficulty on making the off LGN's dark center bright boundary 's effect. I would like to ask, which software do you use to make that image ? Sorry for this details and technique question.

@dancehours
Copy link
Author

This is the right link. https://ioam.github.io/topographica/Tutorials/gcal.html

@jbednar
Copy link
Member

jbednar commented Feb 21, 2019

That's a screenshot from the Tk gui's model editor.

@dancehours
Copy link
Author

dancehours commented Jan 27, 2022

This error seems to indicate that when you saved the snapshot last time, some code of yours previously defined an attribute named maximum, but that attribute is no longer defined in your code so that pickle is failing when it tries to restore that attribute. If maximum isn't important, you can probably put in a dummy declaration for it so that the pickle loading no longer fails, but there may be other changes needed.

Hi Bednar, I am not sure how to define a dummy declaration in the definition of load_snapshot properly, could you show me this ?

@dancehours
Copy link
Author

Hi Bednar, I am sorry I ask the very old question now. I am stuck with this problem in my project and really need to solve it soon.
Could you please give me some suggestions ?

@jbednar
Copy link
Member

jbednar commented Feb 11, 2022

Sorry; it's very difficult to debug that without the running session and all your files. A message like that usually indicates that the python code you are running does not match the code that you had when you saved the pickle. At the time of the pickle, there was a module with an object 'maximum' defined, but now there isn't such an object declared in that module, so when pickle tries to restore its state, it fails. From the message I can't tell what module that might be, but if you can figure out which one it is, load the __init__.py file from it into an editor, and add a dummy declaration like class maximum(object): pass. Then maybe loading that pickle will succeed. I can't theorize why maximum would have disappeared from your source tree; maybe it's simply that you're using a different Topographica version or some other different files of your own. Sorry I can't be more help than that; Pickle files very often don't give useful error messages!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants