noahgolmant / pytorch-hessian-eigenthings

Efficient PyTorch Hessian eigendecomposition tools!
MIT License
360 stars 43 forks source link

Difficulty using in Colabs. #25

Closed xaviergonzalez closed 5 years ago

xaviergonzalez commented 5 years ago

Hello!

I am trying to use your code in Google Colabs.

It seems I can download it just fine:

!pip install --upgrade git+https://github.com/noahgolmant/pytorch-hessian-eigenthings.git@master#egg=hessian-eigenthings

gives output

Collecting hessian-eigenthings from git+https://github.com/noahgolmant/pytorch-hessian-eigenthings.git@master#egg=hessian-eigenthings Cloning https://github.com/noahgolmant/pytorch-hessian-eigenthings.git (to revision master) to /tmp/pip-install-wkuzii9d/hessian-eigenthings Requirement already satisfied, skipping upgrade: numpy>=0.14 in /usr/local/lib/python3.6/dist-packages (from hessian-eigenthings) (1.14.6) Requirement already satisfied, skipping upgrade: torch>=0.4 in /usr/local/lib/python3.6/dist-packages (from hessian-eigenthings) (0.4.0) Building wheels for collected packages: hessian-eigenthings Building wheel for hessian-eigenthings (setup.py) ... done Stored in directory: /tmp/pip-ephem-wheel-cache-k1dx3b0r/wheels/ad/08/af/6413ff138430f7a58324c31d6e0326531b31515ed81f4d7ef3 Successfully built hessian-eigenthings Installing collected packages: hessian-eigenthings Found existing installation: hessian-eigenthings 0.0.0 Uninstalling hessian-eigenthings-0.0.0: Successfully uninstalled hessian-eigenthings-0.0.0 Successfully installed hessian-eigenthings-0.0.0

However, when I then try

from hessian_eigenthings import compute_hessian_eigenthings

as recommended by your readme, I get the following error message:

`--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 from hessian_eigenthings import compute_hessian_eigenthings ModuleNotFoundError: No module named 'hessian_eigenthings' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below.` Do you know why this might be occuring?
noahgolmant commented 5 years ago

I've never worked with Colab before so I can't provide much help, but have you tried restarting the kernel after running the pip command?

noahgolmant commented 5 years ago

Going to close this since this is probably a colab issue