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

Can't run tutorial in notebook #148

Closed
2 of 8 tasks
matham opened this issue Dec 6, 2021 · 6 comments
Closed
2 of 8 tasks

Can't run tutorial in notebook #148

matham opened this issue Dec 6, 2021 · 6 comments
Assignees
Labels
1-bug Something isn't working area: tutorials Issues with something in lava/tutorials os: windows Issues that are specific to Windows
Projects

Comments

@matham
Copy link
Contributor

matham commented Dec 6, 2021

Objective of issue: Tutorial crashes

Lava version:

  • current main (dec 6)
  • 0.3.0 (feature release)
  • 0.2.1 (bug fixes)
  • 0.2.0 (current version)
  • 0.1.2

I'm submitting a ...

  • bug report
  • feature request
  • documentation request

I'm simply running through the cells of the tutorial one after the other from the GUI for tutorial02_processes and it freezes and the logs show the following error:

$ jupyter notebook
[I 14:59:09.234 NotebookApp] Serving notebooks from local directory: G:\Python\lava\lava
[I 14:59:09.234 NotebookApp] Jupyter Notebook 6.4.6 is running at:
[I 14:59:09.234 NotebookApp] http://localhost:8888/
[I 14:59:09.234 NotebookApp]  or http://127.0.0.1:8888/?token
[I 14:59:09.234 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:59:09.303 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/Matthew%20Einhorn/AppData/Roaming/jupyter/runtime/nbserver-17496-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token
     or http://127.0.0.1:8888/?token
[W 14:59:34.725 NotebookApp] Notebook tutorials/in_depth/tutorial02_processes.ipynb is not trusted
[I 14:59:36.725 NotebookApp] Kernel started: dc72d164-3797-45f8-b4b4-ba468a763ba4, name: python3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Matthew Einhorn\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\Matthew Einhorn\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
AttributeError: Can't get attribute 'PyLifModel' on <module '__main__' (built-in)>
[I 15:01:36.642 NotebookApp] Saving file at /tutorials/in_depth/tutorial02_processes.ipynb
@PhilippPlank
Copy link
Contributor

I assume your OS is MS Windows? This is the same issue as described here #95 correct?
We are looking into this.

@PhilippPlank PhilippPlank self-assigned this Dec 7, 2021
@PhilippPlank PhilippPlank added 1-bug Something isn't working area: tutorials Issues with something in lava/tutorials labels Dec 7, 2021
@PhilippPlank PhilippPlank added this to Uncategorized in lava via automation Dec 7, 2021
@PhilippPlank PhilippPlank moved this from Uncategorized to Important | Urgent in lava Dec 7, 2021
@matham
Copy link
Contributor Author

matham commented Dec 7, 2021

Yes, it is! Didn't see it :(

@PhilippPlank
Copy link
Contributor

PhilippPlank commented Dec 7, 2021

No worries, I just wanted to know if it is the same issue or a new one ;)
We will work on fixing it in the next weeks, until then a workaround would be to export the jupyter notebook into a python script via File -> Download as -> Python (.py) and run the python script instead of the notebook.

@awintel
Copy link
Contributor

awintel commented Dec 8, 2021

You do not even have to go that far if you prefer to mostly work in jupyter for your own example. You can also just put Process and ProcessModel definitions into a separate file and import it into jupyter from there.

This is related to a Python multiprocessing issue on Windows that we are currently using in the background.

This will likely not get resolved in 2021 anymore due to the approaching holiday season but who knows...

@Synchronicity89
Copy link

In Windows 10, using Visual Studio Community to run python files, and Visual Studio Code to run Jupyter notebook files, I have had varied results with tutorials. Sometimes I have to export the tutorial and then it runs OK in VSComm. Other times it runs better in the Jupyter notebook in Code. For example, after fixing this line in tutorials\in_depth\tutorial04_execution:

# runtime = Runtime(run_cond=run_condition, exe=executable)
runtime = Runtime(executable, ActorType.MultiProcessing)

It no longer crashes but runs better in Jupyter notebook

@mgkwill mgkwill added the os: windows Issues that are specific to Windows label Jul 29, 2022
@PhilippPlank
Copy link
Contributor

PhilippPlank commented Aug 2, 2022

I will close this issue to remove duplicates. Please discuss further in #247. The issue is not solved yet.

lava automation moved this from Important | Urgent to Done Aug 2, 2022
@PhilippPlank PhilippPlank closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working area: tutorials Issues with something in lava/tutorials os: windows Issues that are specific to Windows
Projects
lava
Done
Development

No branches or pull requests

5 participants