google / stereo-magnification

Code accompanying the SIGGRAPH 2018 paper "Stereo Magnification: Learning View Synthesis using Multiplane Images"
https://people.eecs.berkeley.edu/~tinghuiz/projects/mpi/
Apache License 2.0
389 stars 87 forks source link

ImportError: cannot import name 'mpi_net' from 'nets' #35

Open noobtoob4lyfe opened 3 years ago

noobtoob4lyfe commented 3 years ago

Hi.
Do we need a version of nets from 2018 to get this working? If you go to version history of nets https://pypi.org/project/nets/#history the furthest back you can go is May 22nd of 2020. Can you explain how to get around the error "ImportError: cannot import name 'mpi_net' from 'nets'" ? Thanks!

reyet commented 3 years ago

It's not supposed to import mpi_net from pypi.org, it's supposed to import it from https://github.com/google/stereo-magnification/blob/master/stereomag/nets.py which you can see defines mpi_net at line 23. Perhaps your python path is not set up to find the right source files?

On Tue, Mar 30, 2021 at 1:17 PM noobtoob4lyfe @.***> wrote:

Hi. Do we need a version of nets from 2018 to get this working? If you go to version history of nets https://pypi.org/project/nets/#history the furthest back you can go is May 22nd of 2020. Can you explain how to get around the error "ImportError: cannot import name 'mpi_net' from 'nets'" ? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/stereo-magnification/issues/35, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE54MLLDYOIWHFQRGZTUIDLTGIBTTANCNFSM42CRAORA .

noobtoob4lyfe commented 3 years ago

It's not supposed to import mpi_net from pypi.org, it's supposed to import it from https://github.com/google/stereo-magnification/blob/master/stereomag/nets.py which you can see defines mpi_net at line 23. Perhaps your python path is not set up to find the right source files? On Tue, Mar 30, 2021 at 1:17 PM noobtoob4lyfe @.***> wrote: Hi. Do we need a version of nets from 2018 to get this working? If you go to version history of nets https://pypi.org/project/nets/#history the furthest back you can go is May 22nd of 2020. Can you explain how to get around the error "ImportError: cannot import name 'mpi_net' from 'nets'" ? Thanks! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#35>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE54MLLDYOIWHFQRGZTUIDLTGIBTTANCNFSM42CRAORA .

Thanks for your reply. I'm using a google colab notebook, and running "!python ./mpi_from_images.py \". Do I need to add something that tells it about a different python path?

noobtoob4lyfe commented 3 years ago

I tried setting things up again from scratch. should I not be doing "!pip install nets" ??? Is there a way to install the nets module contained in /stereomag/nets.py instead????

reyet commented 3 years ago

Python looks in the directories listed in sys.path to find where to import libraries from. If you are trying to import nets directly into colab, assuming you have the files available locally, you can either set sys.path ( https://docs.python.org/3/tutorial/modules.html#the-module-search-path), or you may be able to just change "import nets" to (for example) "from stereomag import nets".

r/

On Wed, Mar 31, 2021 at 12:57 PM noobtoob4lyfe @.***> wrote:

I tried setting things up again from scratch. should I not be doing "!pip install nets" ??? Is there a way to install the nets module contained in /stereomag/nets.py instead????

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/stereo-magnification/issues/35#issuecomment-811251621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE54MLLR2HIUQKKI65JUD53TGNIARANCNFSM42CRAORA .