Models: ModuleNotFoundError: No module named 'deeplab'

Created on 25 May 2018  路  6Comments  路  Source: tensorflow/models

run train.py
I got this error:

/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "deeplab/train.py", line 21, in
from deeplab import common
ModuleNotFoundError: No module named 'deeplab'

Could anyone help me to resolve the problem?

Most helpful comment

How to solve this problem in windows?

All 6 comments

From tensorflow/models/research/ run the following code:

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

How to solve this problem in windows?

@EternityZY You have to modify your environment variable. The instructions can be found here: https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-path

Given my knowledge in Linux, pwd returns the current directory you are in. So you should add the following to your PYTHONPATH environment variable:

  • path/to/models/research
  • path/to/models/research/slim

Here's what my python path looks like after I do it
tempsnip

If you run the following test afterwards it should work:

# From tensorflow/models/research/
python deeplab/model_test.py

And outputting the following result:

....
----------------------------------------------------------------------
Ran 5 tests in 27.326s

OK

Sounds like this works :) Feel free to re-open with additional questions.

From tensorflow/models/research/ run the following code:

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

why don't I have this file?
I can only see two files in 'tensorflow':

$ cd tensorflow
$ ls

return:
__init__.py __pycache__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirk86 picture kirk86  路  63Comments

pjeambrun picture pjeambrun  路  51Comments

yuanzhuohao picture yuanzhuohao  路  81Comments

edwardHujber picture edwardHujber  路  82Comments

wkelongws picture wkelongws  路  78Comments