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

deeplab tensorflow model_test.py works fine, but can't see import in main #4

Open
ox-prog opened this issue Jun 18, 2021 · 0 comments

Comments

@ox-prog
Copy link

ox-prog commented Jun 18, 2021

Hello, Zubair!
I would like to use deeplab on macOS Python 3.7. I have to install tensorflow v1.15 (due to deeplab compatibility problem).
I install tensorflow models and extract it to:
./PROJECT_NAME/venv/lib/python3.7/site-packages/tensorflow.

Now, I have read in tensorflow installation guide, that I should execute in terminal:

>>> $ pwd
>>> ./PROJECT_NAME/venv/lib/python3.7/site-packages/tensorflow/models/research
>>> $ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim.

After that I test it from the same path: $ python deeplab/model_test.py and it works fine:

Ran 5 tests in 35.463s
OK (skipped=1)

PROBLEM: So, I would like to test it in my project in path PROJECT_NAME/main.py simple way:

from matplotlib import pyplot as plt
import cv2

from model import Deeplabv3
# according your code I trying to run this
deeplab_model = Deeplabv3()

and $ python main.py gives me:

    from model import Deeplabv3
ModuleNotFoundError: No module named 'model'

I have already tried to move deeplab model folder to ./PROJECT_NAME/ and in another way move main.py to deeplab folder:

from deeplab import model # this way import
deeplab_model = Deeplabv3()
NameError: name 'Deeplabv3' is not defined

I'm not very familiar in python. Thanks for any information!

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

1 participant