-
Notifications
You must be signed in to change notification settings - Fork 45.7k
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
ImportError: No module named nets #1842
Comments
Look at Installation!!! From tensorflow/models/export PYTHONPATH=$PYTHONPATH: |
'pwd' is the path of models folder.
Try to set "pwd:pwd/slim" with "/media/media_share/linkfile/models:
/media/media_share/linkfile/models/slim".
2017-07-04 9:32 GMT+08:00 10183308 <[email protected]>:
… thank you .
I have added the PYTHONPATH ,
but it does not work.
***@***.***:/media/media_share/linkfile/models$ echo $PYTHONPATH
/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/
dist-packages:/home/hc/project/caffe2/caffe2/build/
caffe2:/home/hc/project/caffe2/caffe2/build/caffe2/
python:/home/hc/project/caffe_sorce/caffe/python:/usr/local:
/home/hc/project/caffe_sorce/caffe/python:/usr/local:/home/
hc/project/caffe2/caffe2/build::/home/hc:/home/hc/slim:
/home/hc:/home/hc/slim:pwd:pwd/slim
***@***.***:/media/media_share/linkfile/models$ python
object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/media/media_share/linkfile/models/object_detection/builders/model_builder.py",
line 30, in
from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor
as frcnn_inc_res
File "/media/media_share/linkfile/models/object_detection/
models/faster_rcnn_inception_resnet_v2_feature_extractor.py", line 29, in
from nets import inception_resnet_v2
ImportError: No module named nets
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1842 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQrfnvlM0XfHYhlj-2gMb1e3up1qAjxoks5sKZY2gaJpZM4OL73k>
.
|
Ah, it is the problem of "path"! I have trying for several days. When I added in the program code: |
I think it's a trick.... in the document, it said export PYTHONPATH=$PYTHONPATH:'pwd':'pwd'/slim pwd is your local path, however, you should keep mark like this : 'local path':'localpath'/slim |
Thanks a lot! |
Thanks a lot. It worked for me |
Thank you for all! I have solved this problem by run setup.py. Thank you! |
Thanks!!! running |
sudo gedit ~/.bashrc #open bashrc file |
I encountered the same problem on windows. What I did was, I just copied the entire nets folder from slim directory to C:\Python\Python35\Lib\site-packages\object_detection-0.1-py3.5.egg (where I installed object_detection API). Then the error is completely gone. |
I have the same problem and I go to the tensorflow's github for information Note that it's ` instead of ' around the key pwd |
I add export PYTHONPATH="$PYTHONPATH:tensorflow/models/research:/tensorflow/models/research/slim" in my .bashrc file, then source ~/.bashrc file, but I still has this problem. someone can tell me whiy |
It looks like your paths are wrong (unless you have a directory called "tensorflow" at the root of your filesystem, in which case you are missing a '/' at the beginning of your first path) try to include the absolute path. e.g.: |
Thank you! It works!
…------------------------------------------------------------------
发件人:Jeremiah Harbach <[email protected]>
发送时间:2018年8月31日(星期五) 02:15
收件人:tensorflow/models <[email protected]>
抄 送:aweichina <[email protected]>; Comment <[email protected]>
主 题:Re: [tensorflow/models] ImportError: No module named nets (#1842)
It looks like your paths are wrong (unless you have a directory called "tensorflow" at the root of your filesystem, in which case you are missing a '/' at the beginning of your first path)
try to include the absolute path. e.g.:
export PYTHONPATH="$PYTHONPATH:/home/kochsnow/tensorflow/models/research:/home/kochsnow/tensorflow/models/research/slim"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No working for me :/ |
I am able to run on a local machine by adding the right slim path to PYTHONPATH. But when I am trying to run on google colab I am getting error even though I added the slim path with:
Here is my error messages:
|
set PYTHONPATH=C:\Tensorflow\models;C:\Tensorflow\models\research;C:\Tensorflow\models\research\slim |
or copy & paste Slim folder content in |
I think there no C in google colab. Results from above command
|
I did that but still same import error. In case of google colab I did with following command, let me know if path is not correct. Problem solved when I copy nets and deployment. |
Hi guys I'm having an error when I'm trying to run the training using this command:
note: |
|
This did it for me after nothing else worked, thanks! |
thanks you very much. This solution just came al the right time. you save my day |
I add this code sys.path.append("../../models/research/slim/") into /models/research/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extrac |
@hoangnt2601 where exactly did you add the code ? |
For windows, create a text file in your\Anaconda\environment\path\Lib\site-packages, rename it to tensorflow_model.pth, add the following two lines: |
(python35) D:\Code\GitHub\models\research\slim>python setup.py build delete BUILD file under the folder will solve it. |
Hi, export PYTHONPATH=$PYTHONPATH:pwd:pwd/research:pwd/research/slim I ran the above command in the models folder... Hope that helps someone...... |
Thanks a Lot! |
copy the absolute path of your slim folder (we'll call it XYZ), which is inside models/research. |
It really work for me. Thank you! |
do i need to run this everytime ? because when i run train.py the error pops up again |
You can run from the models/research directory exactly this: |
The correct way, if you need only object detection module:
|
I slove this problem !!!!!!!! open slim folder copy net folder and past in object _detection folder |
fo Windows users, you could solve this by setting PYTHONPATH as follows. |
Go to research/slim/ and fire this command |
Check slim exists by Then run - |
It worked for me on Google Colab! |
Go to research/slim/, delete BUILD, and run the following commands fix the 'nets' issue in windows 10 under anaconda virutal env. |
Changing Update: There is a PR #8626 somehow related to this Update2: Found the answer here google-research/tf-slim#6 |
I can't run the Training, maybe someone can help me |
On Windows 10 with Anaconda I used the following hack
|
In Windows, I just copied the nets folder from research/slim directory to lib/site-package in my python environment. |
hey from which directory i must run this command |
when I enter : python object_detection/builders/model_builder_test.py
it shows the wrong : ImportError: No module named nets
could you help me?
thank you very much
The text was updated successfully, but these errors were encountered: