Open TechGenius28 opened 6 years ago
i have same problem too. any solution?
once keep the defintion of the model_builder.py and faster_rcnn_inception_resnet_v2_feature_extractor.py
i have same problem too. any solution?
I can solve your problem, once share me your project directory list.
run this command set PYTHONPATH=C:\tensorflow1\models set PYTHONPATH=C:\tensorflow1\models\research set PYTHONPATH=C:\tensorflow1\models\research\slim
run the following commands from the C:\tensorflow1\models\research directory:
C:\tensorflow1\models\research> python setup.py build C:\tensorflow1\models\research> python setup.py install
I was having the same error and this solved my problem https://github.com/tensorflow/models/issues/1842#issuecomment-377925135
keep the nets folder in the object detection folder and change your importing code to
from object_dectection.nets import (your_required_python file or class/function in python file)
keep the nets folder in the object detection folder
nets folder is present in research/slim directory
or
From tensorflow/models/research/
run this command on terminal
export PYTHONPATH=$PYTHONPATH:pwd
:pwd
/slim
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install
models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!!
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install
models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!!
Worked perfectly! Thanks a lot.
Traceback (most recent call last):
File "train.py", line 51, in
How can I fix this error?
Traceback (most recent call last): File "train.py", line 51, in from object_detection.builders import model_builder File "C:\Users\regie\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\model_builder.py", line 35, in from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res File "C:\Users\regie\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in from nets import inception_resnet_v2 ModuleNotFoundError: No module named 'nets'
How can I fix this error?
That's because your train.py script is not finding the scripts from the nets folder. You should do as iggy12345 said and install those packages to the python you are using.
Thank you very much.
On Mon, 11 Mar 2019 11:04 PM Alan notifications@github.com wrote:
Traceback (most recent call last): File "train.py", line 51, in from object_detection.builders import model_builder File "C:\Users\regie\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\model_builder.py", line 35, in from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res File "C:\Users\regie\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in from nets import inception_resnet_v2 ModuleNotFoundError: No module named 'nets'
How can I fix this error?
That's because your train.py script is not finding the scripts from the nets folder. You should do as iggy12345 said and install those packages to the python you are using.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/150#issuecomment-471576976, or mute the thread https://github.com/notifications/unsubscribe-auth/AuL1K1LPfMCXS_w5mAbWouSTr7E8-8Gzks5vVnCOgaJpZM4W1SxU .
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install
models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!!
IT WORKS FLAWLESSLY!!!!! THANK YOU SO VERY MUCH
Hi guys I'm having a similar error when I'm trying to run the training using this command:
python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config
this is the error that I'm having:
Traceback (most recent call last): File "train.py", line 51, in <module> from object_detection.builders import model_builder File "C:\tensorflow1\models\research\object_detection\builders\model_builder.py", line 35, in <module> from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res File "C:\tensorflow1\models\research\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in <module> from nets import inception_resnet_v2 ModuleNotFoundError: No module named 'nets'
note: the setup.py file is already exist in the slim folder directory plz guys help me out
@MohammadDabbas did you get the solution??? Bcz im getting the same scenario
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!!
IT WORKS FLAWLESSLY!!!!! THANK YOU SO VERY MUCH
Brother I have the setup file but the 'install' wont run having the error as
"could not create 'build':Cannot create a file when that file already exits"
If you know the solution then plz help
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!!
IT WORKS FLAWLESSLY!!!!! THANK YOU SO VERY MUCH
Brother I have the setup file but the 'install' wont run having the error as "could not create 'build':Cannot create a file when that file already exits" If you know the solution then plz help
Same problem here, if anyone has a solution then please post it. I have tried the solutions mentioned above
in the C:\tensorflow1\models\research\slim directory run python setup.py build python setup.py install models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!! IT WORKS FLAWLESSLY!!!!! THANK YOU SO VERY MUCH Brother I have the setup file but the 'install' wont run having the "could not create 'build':Cannot create a file when that file already exits" If you know the solution then plz help
Same problem here, if anyone has a solution then please post it. I have tried the solutions mentioned above Same problem
Solution:
@kamal0803
If you open python on your shell, run import sys
and then print(sys.path)
you will see a list of all the PYTHONPATH items in a list. To remove this error, this list must include a path to the slims, models and research directory. You can try set PYTHONPATH=path_name_to_directory
. However if that does not work then you can also consider manually adding the pathname by going on My PC --> Properties -->Advanced System Settings --> Environment Variables and then add a new variable in System Variables.
This worked for me, also remember that even after you have added the pathnames, you will need to restart the shell or sometimes even the PC for it to reflect of sys.path
Solution: @kamal0803 If you open python on your shell, run
import sys
and thenprint(sys.path)
you will see a list of all the PYTHONPATH items in a list. To remove this error, this list must include a path to the slims, models and research directory. You can tryset PYTHONPATH=path_name_to_directory
. However if that does not work then you can also consider manually adding the pathname by going on My PC --> Properties -->Advanced System Settings --> Environment Variables and then add a new variable in System Variables.This worked for me, also remember that even after you have added the pathnames, you will need to restart the shell or sometimes even the PC for it to reflect of sys.path
I tried your solution, but its still not working..Please give another solution to this problem
Solution: @kamal0803 If you open python on your shell, run
import sys
and thenprint(sys.path)
you will see a list of all the PYTHONPATH items in a list. To remove this error, this list must include a path to the slims, models and research directory. You can tryset PYTHONPATH=path_name_to_directory
. However if that does not work then you can also consider manually adding the pathname by going on My PC --> Properties -->Advanced System Settings --> Environment Variables and then add a new variable in System Variables.This worked for me, also remember that even after you have added the pathnames, you will need to restart the shell or sometimes even the PC for it to reflect of sys.path
Also, I am using a CPU version of tensorflow.
I am also using a CPU version, but that should not be an issue, where have you saved the environment variable, mine is saved like this:
And also on your cmd, run python
then import sys
then print(sys.path)
.
You may have added your paths to PATH variable but you need to add it to PYTHONPATH variable in the environment variables like in the image above
I am also using a CPU version, but that should not be an issue, where have you saved the environment variable, mine is saved like this:
And also on your cmd, run
python
thenimport sys
thenprint(sys.path)
. You may have added your paths to PATH variable but you need to add it to PYTHONPATH variable in the environment variables like in the image above
Sir,
Its still not working. Please help. I have sent the screenshots
Can it be a possibility that the files might been corrupt because of so many hit and trials.??
Can you check in your folders if you have the nets folder inside slim directory?
Yes sir
Can you check in your folders if you have the nets folder inside slim directory?
Sir,the error I got, I checked it on github..The link to its solution is
https://github.com/tensorflow/models/issues/5138
But i am not able to find a solution Please help.
run this command set PYTHONPATH=C:\tensorflow1\models set PYTHONPATH=C:\tensorflow1\models\research set PYTHONPATH=C:\tensorflow1\models\research\slim
run the following commands from the C:\tensorflow1\models\research directory:
C:\tensorflow1\models\research> python setup.py build C:\tensorflow1\models\research> python setup.py install
Super bro...... Thank you soooooo much
you should do the setpython path so that the error will disappear.
On Thu, 18 Apr 2019 1:26 PM Itachi-Uchia notifications@github.com wrote:
@MohammadDabbas https://github.com/MohammadDabbas did you get the solution??? Bcz im getting the same scenario
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/150#issuecomment-484360747, or mute the thread https://github.com/notifications/unsubscribe-auth/ALRPKKZDP363DGZFKRBMJBDPRAA6PANCNFSM4FWVFRKA .
I'm already do that. But " No module named 'nets' " message still occurs
make sure your directory is correct
On Wed, Aug 7, 2019, 16:34 RedBean_Kim notifications@github.com wrote:
I'm already do that. But ModuleNotFoundError: No module named 'nets' message still occurs
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/150?email_source=notifications&email_token=ALRPKK2DDY4TZQR5PIXLPSDQDKCHVA5CNFSM4FWVFRKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3XUZYQ#issuecomment-518999266, or mute the thread https://github.com/notifications/unsubscribe-auth/ALRPKK4GTVZXWTUQZVOQ2X3QDKCHVANCNFSM4FWVFRKA .
@tamasino52 There might be a possibility that the files must have got corrupt. In this case, do everything from scratch and u will get the desired result. It happened the same with me.
I'm already do that. But " No module named 'nets' " message still occurs
for colab you can try this import os os.environ['PYTHONPATH']=os.environ['PYTHONPATH']+':/content/models/research/slim'
set PYTHONPATH=C:\tensorflow1\models\research\slim
i'm already do like this but this appear
this = _pywrap_tensorflow_internal.new_CheckpointReader(filename) tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt: Not found: FindFirstFile failed for: C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28 : The system cannot find the path specified. ; No such process
anny solution?
set PYTHONPATH=C:\tensorflow1\models\research\slim
i'm already do like this but this appear
this = _pywrap_tensorflow_internal.new_CheckpointReader(filename) tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt: Not found: FindFirstFile failed for: C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28 : The system cannot find the path specified. ; No such process
anny solution?
Are you sure from the path (C:\tensorflow1\models\research\slim)?
set PYTHONPATH=C:\tensorflow1\models\research\slim
i'm already do like this but this appear this = _pywrap_tensorflow_internal.new_CheckpointReader(filename) tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt: Not found: FindFirstFile failed for: C:/tensorflow1/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28 : The system cannot find the path specified. ; No such process anny solution?
Are you sure from the path (C:\tensorflow1\models\research\slim)?
yes exactly like this run this command set PYTHONPATH=C:\tensorflow1\models set PYTHONPATH=C:\tensorflow1\models\research set PYTHONPATH=C:\tensorflow1\models\research\slim
run the following commands from the C:\tensorflow1\models\research directory:
C:\tensorflow1\models\research> python setup.py build C:\tensorflow1\models\research> python setup.py install
after that i'm running this command python legacy/train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config and error appear
run this command
set PYTHONPATH=C:\tensorflow1\models set PYTHONPATH=C:\tensorflow1\models\research set PYTHONPATH=C:\tensorflow1\models\research\slim !!! also> set PYTHONPATH=C:\tensorflow1\models\research\slim\net
run the following commands from the C:\tensorflow1\models\research directory:
C:\tensorflow1\models\research> python setup.py build C:\tensorflow1\models\research> python setup.py install
The mistake I made was using setup.py instead of python setup.py
For those who had such an error: "could not create 'build':Cannot create a file when that file already exits" when trying to build the setup.py in the slim folder. You need to delete a file called 'BUILD" in the slim folder. and it will work.
I solved this error by copying nets and deployment directories to the directory where train.py is
For those who had such an error: "could not create 'build':Cannot create a file when that file already exits" when trying to build the setup.py in the slim folder. You need to delete a file called 'BUILD" in the slim folder. and it will work. @Rams901 Your answer helped me!!!,thanks!
if you are using Jupyter Notebook
and using Linux sys
download tensorflow-models
and then write this in your Notebook
sys.path.append("/home/Roy/Downloads/models-master/research/slim/")
I solved my problem with this
hope it helps
I am experiencing an issue when running the 'train.py' command.
This error keeps reoccurring:
File "train.py", line 52, in
from object_detection.builders import model_builder
File "C:\Users\owner\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.6.egg\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 "C:\Users\owner\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in
from nets import inception_resnet_v2
ModuleNotFoundError: No module named 'nets'
Please could somebody help me out. Thanks