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

Fails on Colab with Error in callback <bound method CellLogger.post_run_cell of <ipyexperiments.cell_logger.CellLogger object >> #5

Closed
rahulraj80 opened this issue Jun 13, 2020 · 2 comments

Comments

@rahulraj80
Copy link

Unable to even load it once.
Minimum example to replicate the issue

[IN:1]

!pip install -q ipyexperiments
import ipyexperiments as ipye
print(ipye.__version__)

[OUT:1]

0.1.17

[IN:2]

exp1 = ipye.IPyExperimentsPytorch()

[OUT:2]

*** Experiment started with the Pytorch backend
Device: ID 0, Tesla K80 (11441 RAM)


*** Current state:
RAM:    Used    Free   Total       Util
CPU:   1,681  11,122  13,021 MB  12.92% 
GPU:     312  11,128  11,441 MB   2.73% 


Error in callback <bound method CellLogger.post_run_cell of <ipyexperiments.cell_logger.CellLogger object at 0x7fcd473018d0>> (for post_run_cell):
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
TypeError: post_run_cell() missing 1 required positional argument: 'result'

Similar failure with
ipye.IPyExperimentsCPU()

Have a look here:
https://colab.research.google.com/gist/rahulraj80/0612b885c6fdf79b828fd38bfeb0e1f9/untitled1.ipynb

@rahulraj80
Copy link
Author

Also tried after running the following, with no effect:

!pip install git+https://github.com/nicolargo/nvidia-ml-py3

@stas00
Copy link
Owner

stas00 commented Jun 15, 2020

Thank you for your report, @rahulraj80

It looks like colab is running an old ipython (5.5.0) which doesn't support the modern ipython events API:
googlecolab/colabtools#891 (comment)

You can upgrade it:
googlecolab/colabtools#891 (comment)

For posterity copying the full code from the above solution here:

!pip install -q --upgrade ipython
!pip install -q --upgrade ipykernel

# Restart with new IPython.
import os
import signal
os.kill(os.getpid(), signal.SIGTERM)

Run that cell, which will report a crash, then run your code normally. then everything works.

I updated the package requirements to require ipython>= 6.0.0, so it will be automatically updated when you install ipyexperiments. But it'll still require restarting the notebook for this to work.

To check which ipython you have run:

import IPython

IPython.version_info
IPython.__version__

@stas00 stas00 closed this as completed Jun 15, 2020
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