How To Train an Object Detection Neural Network Using TensorFlow (GPU) on Windows 10

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 5 тыс.

  • @EdjeElectronics
    @EdjeElectronics  5 лет назад +75

    Hey everyone! I recently updated the written version of this guide to work with TensorFlow versions up to 1.13.1. If you are encountering errors following this video, please check out the guide and make sure you are using the most up-to-date commands. Here are answers to some common questions:
    - Where is the train.py file? The train.py file is now located in the /object_detection/legacy folder. You can copy it to the /object_detection folder and use it as normal.
    - Images aren't appearing when testing the Jupyter notebook, even though there were no errors? Try this: go in to object_detection/utils/visualization_utils.py and comment out the import statements on line 25 and 26 that include matplotlib. Then, re-run the script.
    - Can I run this just using CPU and not GPU? (Yes, just use "pip install tensorflow" instead of "pip install tensorflow-gpu".)
    - How to resolve errors related to _pb2 files? See Step 2f of the guide linked below.
    Check out the guide at github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 !

    • @nicholaspitti8171
      @nicholaspitti8171 5 лет назад +3

      This step(which idk if is neccesary) still wasnt added to the written tutorial.-> 12:05
      set PATH=%PATH%;PYTHONPATH

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад +1

      @@nicholaspitti8171 Yep, I removed it from the written tutorial because it isn't necessary!

    • @kushagra6495
      @kushagra6495 5 лет назад

      i am constantly getting module not found error for tensorflow in jupyter notebook.I followed the instructions on the github page.

    • @AffectiveApe
      @AffectiveApe 5 лет назад +1

      Thanks for the update! I managed to get through 90% of the tutorial a week and a half ago and couldnt figure out what the heck went wrong on the final stretch. Will give it another shot!

    • @SuperHansburger93
      @SuperHansburger93 5 лет назад +1

      I followed the instructions in your tutorial but I'm having this error in jupyter when running object_detection_tutorial. No idea how to solve it as the import instructions are already there...
      i.imgur.com/wp5rtFO.png

  • @2023-c9p
    @2023-c9p 2 года назад +41

    13:38 -> you will find the setup.py in the slim folder copy that into research folder
    13:59 -> Object_detection_tutorial.ipynb - Is located in the "object_detection\colab_tutorials" for anyone who can't find it
    24:19 -> according to fixed comments, train.py file is now located in the /object_detection/legacy folder.
    fpn_pb2 -> protoc --python_out=. .\object_detection\protos\fpn.proto
    center_net_pb2 - > protoc --python_out=. .\object_detection\protos\center_net.proto
    official -> pip install tf-models-official
    etc...
    ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
    If these error were found, I think you should start again from the beginning

  • @ahmadhasan3258
    @ahmadhasan3258 5 лет назад +3

    weeks on the search for a good start tutorial that doesn't have 50+ parts and this is where I land. One of the best clear and concise tutorial/introduction video I've seen so far! Keep it up!!

  • @EdjeElectronics
    @EdjeElectronics  6 лет назад +82

    Here are the issues that have been found so far with this tutorial:
    - TensorFlow moved the train.py file used in Step 6 to the "legacy" folder inside the /object_detection folder. You can still use it by moving it back into the /object_detection folder.
    - If the images aren't appearing in Jupyter notebook at the end of Step 2, try going in to object_detection/utils/visualization_utils.py and comment out both the import statements at the top that include matplotlib. Then, try re-running the Jupyter notebook.
    - Starting at 21:41, I say to change the num_classes variable to 6, but I accidentally changed it to 36. It should be 6. (Thanks Rafael!)
    - Google may add more .proto files to the object_detection/protos folder, so it may be necessary to add more files to the "protoc" command at 13:13. You can do this by adding ".\object_detection\protos\FILENAME.proto" to the end of the long command string for each new file. (Thanks exnaruto1!)
    - When running the "python train.py" command, if you get an error that says "TypeError: __init__() got an unexpected keyword argument 'dct_method'.", then remove the "dct_method=dct_method" argument from line 110 of the object_detection/data_decoders/tf_example_decoder.py file. (Thanks Evpatoria!)
    - When running "python train.py", if you get an error saying "google.protobuf.text_format.ParseError: 110:25 : Expected string but found: '“' ", try re-typing the quotation marks around each of the filepaths. If you copied the filepaths over from my GitHub tutorial, the quotation marks sometimes copy over as a different character type, and TensorFlow doesn't like that.
    - For train.py, if you get an error saying "TypeError: Expected int32, got range(0, 3) of type 'range' instead.", it is likely an issue with the learning_schedules.py file. In the \object_detection\utils\learning_schedules.py file, change line 153
    from "tf.constant(range(num_boundaries), dtype=tf.int32)," to "tf.constant(list(range(num_boundaries)), dtype=tf.int32),".
    - If you are still getting an error complaining about "Expected int32, got range(0, 3)" or something similar, try implementing this fix: github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/11
    Please let me know if you see any more errors with the video or with the commands/instructions from my GitHub repository!

    • @markmackenziesmith
      @markmackenziesmith 6 лет назад +3

      This is a great tutorial, thanks for making it.
      I think I found a small error at 12:01 (ruclips.net/video/Rgpfk6eYxJA/видео.html) when you're setting the PATH variable, I think the line should read:
      SET PATH=%PATH%;%PYTHONPATH%
      or else it won't add the value of the PYTHONPATH variable to the PATH, it'll just add the string PYTHONPATH. If it still works, maybe you don't need to modify the PATH at all, just the PYTHONPATH?

    • @EdjeElectronics
      @EdjeElectronics  6 лет назад +1

      Hmm, I tested it out, and you're right! You only need to set the PYTHONPATH variable; you don't need to make any changes to PATH. I thought adding "PYTHONPATH" to PATH added the variable itself, not just a "PYTHONPATH" string. I'm not very familiar with environment variables :)

    • @jigarparekhplus
      @jigarparekhplus 6 лет назад +1

      WEBCAM VIDEO LAG ISSUE! I have trained my own object classifier using your method with the webcam, the classification is perfect, but I'm facing an issue with the real-time video feed, ie the video lags a lot​. Can you please help me this issue? Thank you.

    • @EdjeElectronics
      @EdjeElectronics  6 лет назад +1

      It seems like a few people are having this issue, so I will look in to it and try to figure it out!

    • @mayankmehta9697
      @mayankmehta9697 6 лет назад

      yeah that would be of great help

  • @KamilRiyas
    @KamilRiyas 6 лет назад +15

    Spent a whole night with this. Totally worth it. Amazing tut man...

    • @dawoodzaidi2018
      @dawoodzaidi2018 6 лет назад

      Hey dude, What is the tensorflow version you used? I'm using 1.9 and I get an error while running training.py "Entry Point Not Found" got an idea?

    • @PixelGM
      @PixelGM 4 года назад

      Why worth it?

    • @mechaitanyashintre
      @mechaitanyashintre 4 года назад

      @Program-o-warrior hello sir could you please help me out. I got version problems with this video

    • @mechaitanyashintre
      @mechaitanyashintre 4 года назад

      @Program-o-warrior bro kindly help

  • @EdjeElectronics
    @EdjeElectronics  Год назад +3

    Hey all, I just uploaded a new video showing how to train TensorFlow object detection models inside your web browser with Google Colab. It's much easier than trying to follow this video! Check it out here:
    ruclips.net/video/XZ7FYAMCc4M/видео.html

    • @KhoaNguyen-bo6zy
      @KhoaNguyen-bo6zy 5 месяцев назад

      but i do not conect gpu in google colab ?

  • @amankaushik5833
    @amankaushik5833 4 года назад +3

    very less start from scratch tutorials on youtube Thank you!!

  • @MicahYeah
    @MicahYeah 5 лет назад +2

    God dude the beginning camera footage is so cool to watch

  • @leafiadias96
    @leafiadias96 3 года назад +5

    a shortcut while labelling the images is to make use of
    w - to start capturing the area (selecting)
    d- to move to the next image
    also , auto save your work

  • @alexroque91
    @alexroque91 6 лет назад +5

    Great Tutorial! Go to 16:20 for cat-cable ultimate battle!

  • @AndreyNikishaev
    @AndreyNikishaev 4 года назад

    You can master Object Detection in this specialized practical online course: learnml.today

  • @AeroAndZero
    @AeroAndZero 4 года назад +9

    These settings seem to work for me :
    Tensorflow 1.13.1
    Tensorflow-gpu 1.15
    Cuda version 10.0
    *Important* : From tensorflow model github repo, Only clone from the branch "r1.13.0" otherwise it will not work

    • @renakiravtuber
      @renakiravtuber 4 года назад

      Did u install tensorflow and tensorflow-gpu together? o.o

    • @AeroAndZero
      @AeroAndZero 4 года назад +2

      @@renakiravtuber first i install tensorflow with this command : pip install tensorflow==1.13.1 --ignore-installed
      and then i installed tensorflow-gpu with this command : pip install tensorflow-gpu==1.15
      notice that i didn't put --ignore-installed in tensorflow-gpu as it messes up all the packages for tensorflow 1.13.1

    • @renakiravtuber
      @renakiravtuber 4 года назад

      @Aero'N'Zero thanks :) what about ur CUDA and cudnn versions?

    • @renakiravtuber
      @renakiravtuber 4 года назад

      @@AeroAndZero what about ur cuda and cudnn versions

    • @AeroAndZero
      @AeroAndZero 4 года назад +1

      ​@@renakiravtuber I used cuda version 10.0 and cudnn v7.6.5 for cuda 10.0
      Make sure to update your graphic card driver to the latest version
      I have this gpu : 920MX (for laptop)

  • @rufusdwamena8866
    @rufusdwamena8866 2 года назад +3

    24:15 i keep getting the following error - ImportError: No module named 'tensorflow.compat' - is there any solution to this, ive scowered the internet and cant find one

  • @maheqsaalamsyah4315
    @maheqsaalamsyah4315 4 года назад +3

    Bro why is the code content in object_detection_tutorial.ipynb not same with the tutorial you make?

  • @MajinVegeto89
    @MajinVegeto89 2 года назад

    You deserve a lot of credit for making this video. There are many tensorflow/machine learning tutorials online but few that really show you this detailed from getting started to creating your model and training it.

  • @Creek1575
    @Creek1575 4 года назад +3

    Sir @Edje Electronics, does this work even if im not using Tensorflow-Gpu?

  • @jesuschrist1501
    @jesuschrist1501 5 лет назад +3

    thanks for this tutorial, was looking for something exactly like this, other videos don't go into details like, just skip here and there bam already trained data and detecting, i wanted to know how it looks like from start to finish cuz it was hard just trying to grasp text tutorials.

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад

      Thanks! If you run into issues while working through the guide, be sure to check my written guide. It has small updates for newer versions of TensorFlow (my pinned comment on this video also shows what the updates are): github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

  • @rawahamuhammad7805
    @rawahamuhammad7805 4 года назад +6

    For those of you looking for the new zoo model link:
    github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1_detection_zoo.md
    The Jupyter notebook is now in:
    C:\tensorflow1\models
    esearch\object_detection\colab_tutorials
    Update: I got the project to working.. what you guys should really do is:
    Clone the git repository and then switch to the branch version of the video, this way you guys will have the same directory structure as shown in the video.

    • @GarethBolton
      @GarethBolton 4 года назад

      9143 Rawaha Muhammad do I have to do this in order to see the images appear in the notebook? I ran it and no images appear

    • @rawahamuhammad7805
      @rawahamuhammad7805 4 года назад

      @@GarethBolton you should only do this if you're having trouble following the tutorial for file directories.. because these are the new locations of the model and the notebook.
      You can look at the guideline in the GitHub repo if you're doing everything right and the images don't show up.

    • @ano8929
      @ano8929 4 года назад

      Which python and tensorflow version did you use?..I am getting many errors using tf 1.5

    • @mechaitanyashintre
      @mechaitanyashintre 4 года назад

      @@ano8929 same here

    • @mechaitanyashintre
      @mechaitanyashintre 4 года назад

      @@rawahamuhammad7805 kindly help for newer version

  • @AlexAcostaB
    @AlexAcostaB 4 года назад +1

    This is the exact explanation that I needed it about how the training process gets "stored" with the 5 minutes checkpoints by tensorflow. I'll try to replicate this in a Mac environment and then somewhere in the cloud. Thanks for this video, you rocks!

  • @anmjubaer
    @anmjubaer 5 лет назад +3

    I am getting:
    AttributeError: module 'tensorflow' has no attribute 'contrib'.
    Any solution?

    • @AeroAndZero
      @AeroAndZero 4 года назад +1

      this tutorial won't work on tensorflow version 2.0
      try these settings as they seem to work for me :
      Tensorflow 1.13.1
      Tensorflow-gpu 1.15
      Cuda version 10.0
      Important : From tensorflow model github repo, Only clone from the branch "r1.13.0" otherwise it will not work

  • @cirianar
    @cirianar 3 года назад +6

    Whenever I run the python setup.py build
    /install command, it says it cant find a setup.py file in the directory of C:\tensorflow1\models
    esearch>

    • @mohamedimran3193
      @mohamedimran3193 3 года назад

      @Edje Electronics, I'm also getting this error. Can someone help, please?

    • @cirianar
      @cirianar 3 года назад +2

      @@mohamedimran3193 I checked the research/slim folder and there is already a file called "build". Aka in the newer version of tensorflow object detection API u dont need to run these sepcific set of commands.
      If I were you I wouldnt follow this tutorial as I ran into a ton of errors pertaining to me using outdated resources mentioned in the tutorials description.

    • @mohamedimran3193
      @mohamedimran3193 3 года назад

      @@cirianar Thank you for your inputs!. So you mean, it's not a good idea to follow this outdated tutorial? or you have something better than can help me. Because I'm badly in need of doing an object detection model for one of my projects

    • @Suliemankh
      @Suliemankh 2 года назад

      @@mohamedimran3193 the setup.py in the slim folder

  • @nguyentuan4589
    @nguyentuan4589 2 года назад +5

    For those who have been stuck with choosing versions of software and modules to use, this is my additional suggestion.
    I am using Windows 10 pro.
    - Installing Anaconda: I chose the last version of anaconda released in 2018 which supports python 3.7.1. Technically, you can use the latest released version.
    - Python version: 3.7.1
    - Tensorflow ver 1.13.1 goes along with its Github commit: github.com/tensorflow/models/tree/r1.13.0
    - NumPy version 1.16.4
    - pandas version 1.1.5
    - Matplotlib version 3.0
    For the rest, I just follow the author's instructions and the support from other guys here. Thanks a lot.

  • @kittuthegreat28
    @kittuthegreat28 5 лет назад +6

    i couldn't get the images at 15:00 ,please help.

    • @dudewhat9329
      @dudewhat9329 4 года назад

      me neither, have you solved it yet?

  • @mallutechygirl
    @mallutechygirl 4 года назад +1

    Sir how to calculatr the accuracy of our model

  • @keshavpatta9946
    @keshavpatta9946 4 года назад +5

    I have a problem while initialising the training
    File "train.py", line 48, in
    from tensorflow.contrib import framework as contrib_framework
    ModuleNotFoundError: No module named 'tensorflow.contrib'
    If any one have solution to this please help.

    • @jonosmilesalot
      @jonosmilesalot 4 года назад

      Did anyone solve this?

    • @moinkhan8900
      @moinkhan8900 4 года назад

      Yess...i got the same error... Bcoz I was using tensorflow 2.x, but it is not yet compatible for training purpose... So u should use tensorflow 1.14 for training

    • @moinkhan8900
      @moinkhan8900 4 года назад

      github.com/tensorflow/models/issues/6423
      U can follow this thread

  • @TheAndre2131
    @TheAndre2131 4 года назад +7

    To everyone having issues with tensorflow 'app' or tensorflow 'contrib' . You need to downgrade your tensorflow version to 1.14. Using tensorflow 2.0 onwards doesn't work. even if you use compat.v1, since 'contrib' was completely removed from tf 2.
    EDIT: for those of you wondering how to do this, go into terminal and activate tensorflow1 environment
    pip uninstall tensorflow
    Wait for it to uninstall
    pip install tensorflow-gpu==1.14
    Wait for it to install and you should be good to go. Be aware that you will have to download the correct versions of CUDA and CUDNN

    • @petermeier6501
      @petermeier6501 4 года назад

      yeah, I'm facing the ' no module named contrib' -error although I'm using tf 1.14 since the beginning. mysterious :O

    • @TheAndre2131
      @TheAndre2131 4 года назад

      @@petermeier6501 can you copy paste the whole stack trace of your errors?

    • @petermeier6501
      @petermeier6501 4 года назад

      @@TheAndre2131 Yes, it's
      Traceback (most recent call last):
      File "model_main.py", line 26, in
      from object_detection import model_lib
      File "/home/pi/tensorflowgit/Tensordatensatz/models/research/object_detection/model_lib.py", line 27, in
      from object_detection import eval_util
      File "/home/pi/tensorflowgit/Tensordatensatz/models/research/object_detection/eval_util.py", line 40, in
      slim = tf.contrib.slim
      File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/util/lazy_loader.py", line 62, in __getattr__
      module = self._load()
      File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/util/lazy_loader.py", line 45, in _load
      module = importlib.import_module(self.__name__)
      File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
      ModuleNotFoundError: No module named 'tensorflow.contrib'
      Do you have any idea what's causing the error o0 ?

    • @TheAndre2131
      @TheAndre2131 4 года назад

      @@petermeier6501 well. Firstly, it's not recommended to use model main.py but instead to use test.py from the legacy folder. Moreover you shouldn't be getting this error if you're using tf1.x could you check if you're in the Correct environement and uninstall and reinstall tensorflow Just in case

    • @petermeier6501
      @petermeier6501 4 года назад

      @@TheAndre2131thanks for the suggestions :), using the train.py file in the legacy folder or reinstalling tf unfortunately didn't do the trick. Trying other models and tf versions now.

  • @busekoseoglu979
    @busekoseoglu979 3 года назад +7

    python: can't open file 'C:\tensorflow1\models
    esearch\setup.py': [Errno 2] No such file or directory Can you help me ? I take this error.

    • @muhammadahmadraza3145
      @muhammadahmadraza3145 3 года назад +1

      C:\tensorflow1\models
      esearch\slim find it here

    • @nguyenduykhanh7888
      @nguyenduykhanh7888 3 года назад

      i did this,you direct to slim and delete file Build then run it.

    • @nesacristin2913
      @nesacristin2913 3 года назад +2

      @@muhammadahmadraza3145 should i change directory to slim or move setup.py to folder research ??

    • @anandkishoriit
      @anandkishoriit 3 года назад

      @@nesacristin2913 move to folder reserach it worked

    • @anandkishoriit
      @anandkishoriit 3 года назад

      move to folder reserach it worked , move build to folder reserach it worked

  • @นายนรินทร์อนงค์ชัย

    Could you tell me how I print name of object as text when detected?

    • @aidos9753
      @aidos9753 5 лет назад +1

      Use the solution here which also gives coordinate information and detection confidence:
      github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/69

  • @kenlabadan3502
    @kenlabadan3502 2 года назад +5

    please help me with this error:
    (tensorflow1) C:\tensorflow1\models
    esearch>python setup.py build
    python: can't open file 'C:\\tensorflow1\\models\
    esearch\\setup.py': [Errno 2] No such file or directory

    • @shahzebawan5540
      @shahzebawan5540 2 года назад

      I am also facing the same issue

    • @shahzebawan5540
      @shahzebawan5540 2 года назад +1

      you should try other models like tf 1.1 and so on , one of them have the setup.py in research folder

    • @kenlabadan3502
      @kenlabadan3502 2 года назад

      @@shahzebawan5540 Thank you.

    • @manjari99
      @manjari99 Год назад

      @@shahzebawan5540 Hi, Can you elaborate I'm stuck at this?

    • @Nicky355
      @Nicky355 Год назад

      I'm stuck at here too

  • @prashantgautam8983
    @prashantgautam8983 5 лет назад +7

    For Tensorflow 2.0 use following command to upgrade generate_tfrecord.py on anaconda promt
    tf_upgrade_v2 --infile generate_tfrecord.py --outfile generate_tfrecord_new.py
    Also in line 23 replace
    # flags = tf.app.flags
    flags = tf.compat.v1.flags

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад

      Thanks! I will update my TensorFlow repository with this info when I get a chance.

    • @badcode8037
      @badcode8037 5 лет назад

      I am still getting the same error :/

    • @peterscales6020
      @peterscales6020 5 лет назад +1

      @@badcode8037 Make sure you use the correct file, generate_tfrecord_new.py, when you run the command(python generate_tfrecord_new.py --csv_input=images\test_labels.csv --image_dir=images\test --output_path=test.record). Otherwise you will get the same error again.

    • @badcode8037
      @badcode8037 5 лет назад

      @@peterscales6020 Thanks a lot. It finally worked

    • @badcode8037
      @badcode8037 5 лет назад

      @@peterscales6020 getting another error when i ran the train.py in cmd- AttributeError: module 'tensorflow' has no attribute 'contrib'

  • @neagoeiulian5573
    @neagoeiulian5573 4 года назад +19

    So, for anyone who is trying to use this tutorial in january 2020, with a ton of help I've finally made it to work out. Here's how:
    For Tensorflow-GPU:
    Download and install NVIDIA CUDA 10.0
    Download cuDNN 7.4.2 for CUDA 10.0 -> open archieve and navigate to the 'bin' folder -> extract the only dll file from there to the CUDA v10.0/bin directory
    Your Tensorflow-GPU is ready to work!
    If you want to use Tensorflow-CPU ignore the steps from above
    Next:
    Download the latest version of models from the github repo linked in the description
    Download the faster_rcnn_inception archieve and extract it into the models/research/object_detection
    Download the Object-Detector API from the repo and extract it's files into models/research/object_detection
    Inside models/research/object_detection delete the inference_graph folder content, as well as the 2 csv files from images and the content of the training folder
    Open an Anaconda Command prompt and create a virtual env:
    C:\>conda create -n tensorflow1 pip python=3.6.10 //the 3.6.10 version its working with my overall setup
    C:\>activate tensorflow1
    (tensorflow1) C:\>pip install tensorflow-gpu==1.13.1 //the 1.13.1 version is working as well
    (tensorflow1) C:\> conda install -c anaconda protobuf
    (tensorflow1) C:\> pip install pillow
    (tensorflow1) C:\> pip install lxml
    (tensorflow1) C:\> pip install Cython
    (tensorflow1) C:\> pip install contextlib2
    (tensorflow1) C:\> pip install jupyter
    (tensorflow1) C:\> pip install matplotlib
    (tensorflow1) C:\> pip install pandas
    (tensorflow1) C:\> pip install opencv-python
    now uninstall numpy:
    (tensorflow1) C:\> pip uninstall numpy
    (tensorflow1) C:\> pip install numpy==1.16.4 //the 1.16.4 v is working
    (tensorflow1) C:\> set PYTHONPATH=C:\tensorflow1\models;C:\tensorflow1\models
    esearch;C:\tensorflow1\models
    esearch\slim
    (tensorflow1) C:\> cd C:\tensorflow1\models
    esearch
    NOW very important: open a file manager and navigate to tensorflow1/models/research/object_detection and search for the "protos" folder.
    Inside this folder you'll see a bunch of .proto files -> you need to make a .pb2 file instance for every single .proto file.
    DO NOT USE the long command from the written tutorial (protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto......)
    Instead, look up for the first .proto file u see inside this folder and write the next command:
    (tensorflow1) C:\>protoc --python_out=. .\object_detection\protos\file_name.proto
    Repeat this command for every file you see inside the folder untill you make sure that every single .proto file has a .pb2 copy (it takes some time but it's the way to go)
    Next:
    (tensorflow1) C:\tensorflow1\models
    esearch> python setup.py build
    (tensorflow1) C:\tensorflow1\models
    esearch> python setup.py install
    BEFORE RUNNING THE JUPYTER COMMAND download the models file for version 1.7 from github -> open the archieve and search for /research/object_detection/object_detection_tutorial.ipynb -> extract that specific file into YOUR ACTUAL MODEL and replace it's own object_detection_tutorial.ipynb (otherwise it will mess your tensorflow version)
    Also, I'm not sure if this whole jupyter step is necessary since I'm still having an import error and the images are not showing, but it's still working out.
    Next:
    (tensorflow1) C:\tensorflow1\models
    esearch\object_detection> python xml_to_csv.py
    Then, generate the TFRecord files by issuing these commands from the \object_detection folder:
    python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
    python generate_tfrecord.py --csv_input=images\test_labels.csv --image_dir=images\test --output_path=test.record
    Do the labelmap thing just as in the tutorial, it's nothing to explain here
    !! Make sure to modify those specific lines inside the config file just as in the written tutorial
    And now you can run the training :
    python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
    Hope it works ! Let me know if it is woking for any of you ! Have a good day!

    • @joker__13
      @joker__13 4 года назад

      imgur.com/a/tKRb18h
      while applying python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
      command

    • @johnlao1469
      @johnlao1469 4 года назад +1

      gotcha

    • @getlost1997
      @getlost1997 4 года назад

      Hi, I'm trying to download the research models (/research/object_detection/object_detection_tutorial.ipynb) from version 1.7 from github, but the research models for all non-current versions were removed?

    • @andrejpiecka
      @andrejpiecka 4 года назад +1

      @@getlost1997 Here is the link for 1.7 models:
      github.com/tensorflow/models/tree/adfd5a3aca41638aa9fb297c5095f33d64446d8f
      Just download this and replace the object_detection_tutorial.ipynb file in the newest model.

    • @getlost1997
      @getlost1997 4 года назад

      @@andrejpiecka Thank you!

  • @brianthemessiah5106
    @brianthemessiah5106 5 лет назад +2

    @EdjeElectronics Hi, I'm in the middle of Step 6 trying to run the training, but when I do so, I come up with "ValueError: No variables to save. " Does this issue sound familiar?

  • @rajmeetsingh1625
    @rajmeetsingh1625 4 года назад +3

    facing error like this
    File "generate_tfrecord.py", line 23, in
    flags = tf.app.flags
    AttributeError: module 'tensorflow' has no attribute 'app'
    please help

    • @presidentislive6297
      @presidentislive6297 4 года назад

      Use tf-gpu version 1.15

    • @aspenplastics
      @aspenplastics 4 года назад

      @@presidentislive6297 I'm using tensorflow-gpu 2.1.0, are you saying i need to go backwards and use 1.15?

    • @mohamedfarj2825
      @mohamedfarj2825 4 года назад

      did you find a way to solve the error ? i got the same issue

  • @aimanhaziq5246
    @aimanhaziq5246 5 лет назад +3

    Hi, want to ask, can i still done this if my laptop's graphic card is not Nvidea? Using intel graphic

    • @aidos9753
      @aidos9753 5 лет назад +1

      Yes but you won't be able to use tensorflow-gpu as it is only compatible with Nvidia cards. You can still use tensorflow on the CPU tho.

    • @offifee8022
      @offifee8022 5 лет назад

      @@aidos9753 So if I use tensorflow CPU I can just follow the other steps the same way, it just probably needs longer to train the network?
      And as far as I understood CUDA and cuDNN are also for GPU support? Do I still need to install them?

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад +1

      @@offifee8022Correct, you don't need to install CUDA and cuDNN. Instead of issuing "pip install tensorflow-gpu" just do "pip install tensorflow". But training will take much longer!

    • @aidos9753
      @aidos9753 5 лет назад +1

      @@offifee8022 That's correct. If you don't have an NVIDIA gpu you can use Tensorflow-CPU and do not need to install CUDA and cuDNN.

    • @offifee8022
      @offifee8022 5 лет назад +1

      @@EdjeElectronics thank you very much!
      I expected a longer training time, that's okay :)

  • @sergiomc
    @sergiomc 4 года назад

    Hi. On your example,your frozen file model is about 50Mb. But mine is 200 or 300 Mb. Why is this big? Is there a problem with the construction or anything im doing? And the file size impacts on video detecting? Thanks for your help.

  • @unterwasseratmendertausend8902
    @unterwasseratmendertausend8902 3 года назад +10

    When I run "python setup.py build" I get the following error: "[Errno 2] No such file or directory". Can anyone please help? Would be very kind

    • @furkancelik7925
      @furkancelik7925 3 года назад

      Did u find the solution?

    • @blazingfest5885
      @blazingfest5885 3 года назад

      Make sure to CD into object detection

    • @TheRAZSOR
      @TheRAZSOR 3 года назад

      @@blazingfest5885 Still not working!

    • @genyuanzhang5046
      @genyuanzhang5046 3 года назад

      @@TheRAZSOR The absence of a setup.py file in the "research" folder is the cause of the problem, but I am still confused about how to solve it. Did you solve this problem?

    • @npk4624
      @npk4624 3 года назад +3

      I move "setup.py" file from "C:\tensorflow1\models
      esearch\object_detection\packages\tf2" (or tf1) folder to "C:\tensorflow1\models
      esearch" folder and I move "object_detection_tutorial.ipynb" file from "C:\tensorflow1\models
      esearch\object_detection\colab_tutorials" folder to "C:\tensorflow1\models
      esearch\object_detection" too for next process, that work for me.

  • @dharania4434
    @dharania4434 4 года назад +3

    hey, just a small question .. can i use the trained model from my pc and run it on a pi?

  • @edgarramos4830
    @edgarramos4830 3 года назад +3

    I had trouble when trying to generate the TFRecord with this command:
    "C:\tensorflow1\models
    esearch\object_detection>python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record"
    It says: "from object_detection.utils import dataset_util
    ModuleNotFoundError: No module named 'object_detection'". Does anyone knows how to solve this?

    • @勁磊李
      @勁磊李 3 года назад

      You can try to recheck the label map in the training fold.

    • @tomdousek5819
      @tomdousek5819 2 года назад

      hello, have you solved this problem, i keep getting the same error and dont know what to do

    • @sunayanadas2171
      @sunayanadas2171 2 года назад

      Please slove this problem.

    • @clay8086
      @clay8086 2 года назад

      i have the same

    • @granatapfel6661
      @granatapfel6661 2 года назад

      pip install object-detection maybe?

  • @제작자납신다
    @제작자납신다 4 года назад +1

    faster_rcnn_inception_v2 is not compatible with tensorflow v2.x
    Is there any way other than uninstall current version and install 1.x older versions?
    Would you recommend me other model compatible to current tensorflow version?

  • @enzolongobucco4914
    @enzolongobucco4914 4 года назад +3

    Hello, here are some tips on what helped me run this model. It includes the versions of the packages that i installed aswell as some notes on how to work arround the steps 1 and 2 of the GitHub manual. I have yet to try and run it with my own personal images so don't expect automatic results...
    NAME OF MY CONDA ENV:
    tf1.13
    GPU:
    nvidia quadro k620
    VERSIONS:
    cudnn 7.3.1
    cuda 10.0_0
    tensorflow-gpu 1.13.1
    tensorflow-estimator 1.13.0
    tensorflow 1.13.1
    pip 10.0.1
    protobuf 3.6.0
    python 3.5
    pillow 7.0.0
    lxml 4.4.2
    cython 0.29.15
    contextlib2 0.6.0.post1
    jupyter 1.0.0
    jupyter-client 6.0.0
    jupyter-console 6.1.0
    jupyter-core 4.6.3
    matplotlib 3.0.3
    pandas 0.25.3
    opencv-python 4.2.0.32
    INSTALLING:
    pip install --ignore-installed --upgrade tensorflow==1.13.1
    conda install -c anaconda cudnn==7.3.1 -> equivalent to 7.4
    CHECKING:
    conda list NAMEOFPACKAGE
    SET PATHS:
    set PYTHONPATH=C:\tf1.13\models;C:\tf1.13\models
    esearch;C:\tf1.13\models
    esearch\slim
    CHECKING:
    echo %PYTHONPATH%
    PROTOBUF COMMAND EXCEPTIONS:
    REMOVED FROM ORIGINAL
    \object_detection\protos\calibration.proto . -> DOES NOT EXIST WITH TF1.13
    \object_detection\protos\flexible_grid_anchor_generator.proto. -> DOES NOT EXIST WITH TF1.13
    SETUP BUILD:
    cd C:\tf1.13\models
    esearch
    python setup.py build
    python setup.py install
    EXECUTE LOCALHOST DEMO:
    cd C:\tf1.13\models
    esearch\object_detection
    jupyter notebook object_detection_tutorial.ipynb
    LINKS:
    TENSORFLOW / PYTHON / CUDA / CUDNN - VERSIONS :
    www.tensorflow.org/install/source#tested_build_configurations
    PREBUILT MODELS:
    github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
    ssd -> low CPU
    MAIN PROJECT:
    github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#1-install-anaconda-cuda-and-cudnn
    I also ran into some DLL problems when executing the jupyter notebook because my Python folder had two. It only took removing one of them to work...
    I hope this helps you!

  • @BhaktiAradhanaa
    @BhaktiAradhanaa 4 года назад +3

    Hi Edje, Thankyou so much for such a beautiful tutorial. I am using Tensorflow 2.0 and was successful in creating the record file, but when trying this "python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config" I am encountering with an issue "File "train.py", line 49, in
    from tensorflow.contrib import framework as contrib_framework
    ImportError: No module named 'tensorflow.contrib'"
    Also tried to downgrade the Tensorflow version, but still not working. Any feedback would be greatly appreciated.

    • @Deepaksaini-od7fd
      @Deepaksaini-od7fd 4 года назад

      Hi Edje, I am also encountering with same issue

    • @ajaynegi2048
      @ajaynegi2048 4 года назад

      Hi Edje I am also facing same issue

    • @jackiestaiger3056
      @jackiestaiger3056 4 года назад

      I am getting the same error as well

    • @BhaktiAradhanaa
      @BhaktiAradhanaa 4 года назад

      Jackie Staiger did you find any solution for this. If yes then please share this with us as well

    • @ajaynegi2048
      @ajaynegi2048 4 года назад

      @@jackiestaiger3056 Bro You need to Tensorflow downgrade to 1.5 and select the Image Detection code V.1.7 for git

  • @rabiabibi8634
    @rabiabibi8634 6 лет назад +5

    Hi! I have no words to thank you. You really helped me. May Allah Pak bless you. Bundle of thanks :)

    • @hamzadbz1
      @hamzadbz1 5 лет назад

      Have you trained a model?

  • @NextLevelCode
    @NextLevelCode 4 года назад +1

    @Edje Electronics I would like to report using your tutorial as a starting point and a lot of googling! I was able to:
    1. Translate all the required information to linux (Ubuntu 18.04)
    2. Get Tensorflow Rocm working (Vega 56 AMD GPU)
    3. Swap out the dataset with my own.
    Vega is humming along as I type this. Training now. Thanks for putting this detailed tutorial together. :)

    • @EdjeElectronics
      @EdjeElectronics  4 года назад

      Great! Glad it worked out! This video is getting a little dated, but the process is mostly the same. Just lots of version management to worry about!

  • @alanpolanco984
    @alanpolanco984 3 года назад +3

    I had this problem running jupyter file: "ImportError: DLL load failed importing win32api".
    Just type "conda install pywin32" and reaload. It works for me.

  • @ewanh
    @ewanh 6 лет назад +4

    By watching this video for 1 min, I found the PUBG and OW attract me more

  • @nontawatnokpet2543
    @nontawatnokpet2543 3 года назад +6

    i view don't have file setup.py in locations file C:\tensorflow1\models
    esearch

    • @shawntaekyukang2343
      @shawntaekyukang2343 3 года назад

      me either

    • @monaibrahim1482
      @monaibrahim1482 3 года назад

      Did you solve it or not
      I have the same error

    • @nguyenduykhanh7888
      @nguyenduykhanh7888 3 года назад

      did you solve this problem bro ,please?

    • @nguyenduykhanh7888
      @nguyenduykhanh7888 3 года назад

      Khánh Nguyễn Duy
      1 giây trước
      i did this,you direct to slim and delete file Build then run it.

    • @anandkishoriit
      @anandkishoriit 3 года назад

      Those who are also searching for the setup python file: github.com/tensorflow/models/blob/master/research/object_detection/packages/tf1/setup.py

  • @JayeshBhaware
    @JayeshBhaware 4 года назад +1

    I am getting this error while exporting Inference Graph.
    File "C:\Users\Masked Lord\AppData\Roaming\Python\Python35\site-packages\tensorflow\contrib\framework\python\ops\gen_variable_ops.py", line 59, in _InitOpDefLibrary
    op_def_lib.add_op_list(op_list)
    NameError: name 'op_def_lib' is not defined

  • @jefferylawrence992
    @jefferylawrence992 4 года назад +2

    Sir can we run this in Google colab and if possible can you help me with the steps

  • @swombhai6493
    @swombhai6493 5 лет назад +3

    Does anyone know how to count the detected objects?

  • @arsulan3801
    @arsulan3801 4 года назад +5

    This is the old tutorial using TF 1.x, for Tensorflow 2.0 I advise you to visit tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html for further training you custom object detector.

    • @O100OSTO
      @O100OSTO 4 года назад

      Have you tried using this tutorial's repository (github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#4-generate-training-data) to successfully installed Tensorflow 2.x API?

    • @Armaan_Priyadarshan
      @Armaan_Priyadarshan 4 года назад +1

      I just made a RUclips tutorial for the new TensorFlow 2 versions it's right here ruclips.net/video/oqd54apcgGE/видео.html

    • @arsulan3801
      @arsulan3801 4 года назад +1

      @@O100OSTO I've tried it, but still got many errors due to the incompatibility of TF versions, In that link which I've mentioned above, is the same procedure as in the video. You can still install and use TF 1 and follow the tutorial, there is no problem for that)

    • @arsulan3801
      @arsulan3801 4 года назад

      @@Armaan_Priyadarshan Great)

  • @dr.ramkumarlakshminarayana9800
    @dr.ramkumarlakshminarayana9800 4 года назад +1

    Patience required to complete, very excellent tutorial

  • @plot.python
    @plot.python 5 лет назад +3

    I figured it out. If anyone gets the same error, after the final "else" in the generate_tfrecord.py change the last line to "return 0" instead of "return none" in the class_text_to_int function.

  • @MohdAkmalZakiIO
    @MohdAkmalZakiIO 5 лет назад +3

    21:45 : 6 classes you mean 6 and not 36 right?

    • @adilhossain227
      @adilhossain227 5 лет назад

      yes it will be 6 , my detection was accurate on 6

    • @badcode8037
      @badcode8037 4 года назад

      It should be 6, he did it by mistake

  • @furkancelik7925
    @furkancelik7925 3 года назад +5

    Guys. I have a problem. While executing python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
    then,
    ImportError: cannot import name 'fpn_pb2' from 'object_detection.protos
    Do you know solution?

    • @coffeebean2541
      @coffeebean2541 3 года назад +4

      @Furkan Çelik you need to convert the fpn.proto to fpn_pb2 by adding .\object_detetction\protos\fpn.proto to the command he gave to convert the .protos file to _pb2, you can do this to any other file that has not been converted by just adding the file name after the protos part of my command

    • @rufusdwamena8866
      @rufusdwamena8866 2 года назад

      did you find a solution to this

  • @SuperNinja201
    @SuperNinja201 4 года назад +1

    Hi, is there a way to get only the precision, recall, true positive, false positive and false negative values? I found that these values are calculated in the metrics.py file but I am unable to print/write these results to a csv file.

  • @nickarchin2372
    @nickarchin2372 5 лет назад +3

    Job offer regarding the same contents from this video. If you are interested and confident then pm me.
    Thanks

  • @김태우-d4k
    @김태우-d4k 5 лет назад +3

    WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
    For more information, please see:
    * github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
    * github.com/tensorflow/addons
    If you depend on functionality not listed there, please file an issue.
    Traceback (most recent call last):
    File "train.py", line 51, in
    from object_detection.builders import model_builder
    File "C:\Users\admin\Anaconda3\envs\objectDetection\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\model_builder.py", line 20, in
    from object_detection.builders import anchor_generator_builder
    File "C:\Users\admin\Anaconda3\envs\objectDetection\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\anchor_generator_builder.py", line 22, in
    from object_detection.protos import anchor_generator_pb2
    File "C:\Users\admin\Anaconda3\envs\objectDetection\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\protos\anchor_generator_pb2.py", line 16, in
    from object_detection.protos import flexible_grid_anchor_generator_pb2 as object__detection_dot_protos_dot_flexible__grid__anchor__generator__pb2
    ImportError: cannot import name 'flexible_grid_anchor_generator_pb2' from 'object_detection.protos' (C:\Users\admin\Anaconda3\envs\objectDetection\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\protos\__init__.py)
    What should I do ???

    • @kitisakprachachoowong7920
      @kitisakprachachoowong7920 5 лет назад

      me too. please help?
      WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
      For more information, please see:
      * github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
      * github.com/tensorflow/addons
      If you depend on functionality not listed there, please file an issue.
      Traceback (most recent call last):
      File "train.py", line 51, in
      from object_detection.builders import model_builder
      File "C:\Users\Windows\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\model_builder.py", line 20, in
      from object_detection.builders import anchor_generator_builder
      File "C:\Users\Windows\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\builders\anchor_generator_builder.py", line 22, in
      from object_detection.protos import anchor_generator_pb2
      File "C:\Users\Windows\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\protos\anchor_generator_pb2.py", line 16, in
      from object_detection.protos import flexible_grid_anchor_generator_pb2 as object__detection_dot_protos_dot_flexible__grid__anchor__generator__pb2
      ImportError: cannot import name 'flexible_grid_anchor_generator_pb2' from 'object_detection.protos' (C:\Users\Windows\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\protos\__init__.py)

  • @9zetsu
    @9zetsu 4 года назад +4

    Hi! I see you are playing shooters. Are you considering to try Valorant?

    • @EdjeElectronics
      @EdjeElectronics  4 года назад +1

      I haven't heard of Valorant, but I'll check it out! I mostly play CS:GO and Apex Legends nowadays :)

    • @9zetsu
      @9zetsu 4 года назад

      @@EdjeElectronics Valorant is an upcoming fps from Riot Games (League of Legends developers). They promise a low ping, 128 tick rates and strong anti cheat. The game itself us a blend between CS:GO and Overwatch, where instead of buying grenades you should buy character abilities, that create tactical advantages.
      Today you can have the chance to get a key for closed beta.

  • @afrinandasakinah693
    @afrinandasakinah693 3 года назад

    excuse me, I want to ask something. What CUDA and CUDNN version do you use? I got error of Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.

    • @ajisann
      @ajisann 3 года назад +1

      hi! I used CUDA Toolkit 10 and CUDNN 7.6 for tensorflow 1.13.1. Make sure you check system requirements of tensorflow ( www.tensorflow.org/install/source_windows (could be changed, depends on your OS)) and gpu support for tensorflow (I used nVIDIA GTX 1060 6gb).
      For some "unnormal" problems (like cannot find cudart64_91.dll cudart64_90.dll), I also install CUDA Toolkit ver 9.1 and 9.0. However, for both packages, I ONLY install the CUDA component (in custom installation options, uncheck Driver components, Other components, and GeForce Experience components). And I'm not using CUDNN for both package, just the main CUDA (10.0). Hope it'll help.

    • @afrinandasakinah693
      @afrinandasakinah693 3 года назад

      @@ajisann yeah, thank you so much! my previous cuDNN version was 7.4, then I changed into 7.6 and it works.

  • @mostafaatef7483
    @mostafaatef7483 5 лет назад +4

    Important notes I've noticed while following this tutorial,
    1.Type the full syntax command "conda create -n tensorflow1 pip python=x.x" *Python 3.6 is good enough* While creating your virtual environment, The default python version used with me was 3.7 which is not compatible with TensorFlow so far and I had to downgrade it.
    2.The same problem but with TensorFlow version, I had Tensorflow 1.13.1, I had to downgrade it to 1.10.x to fix the error.
    Follow this link for more details about the error causes:
    github.com/tensorflow/tensorflow/issues/22794

    • @fabricioteixeira6843
      @fabricioteixeira6843 5 лет назад +1

      Hey, did train your own model? I wanna train a model that recognize systems screens, like outlook and etc... Could give me a help?

    • @fabricioteixeira6843
      @fabricioteixeira6843 5 лет назад

      Nikko Morabe fabricio.siqueira9 my Skype

    • @fabricioteixeira6843
      @fabricioteixeira6843 5 лет назад

      Nikko Morabe m.facebook.com/fabricio.siqueira.148

    • @KKKK-jr1nm
      @KKKK-jr1nm 5 лет назад

      @Nikko Morabe Can you help me please,I have a similar issue.

    • @nicholaspitti8171
      @nicholaspitti8171 5 лет назад

      I just used Anaconda navigator to create the environment and it worked for me. Using python 3.5 and tensorflow 1.12

  • @denisardelean8067
    @denisardelean8067 4 года назад +4

    This tutorial is too outdated, please update it

    • @rafaelromeromunhoz9826
      @rafaelromeromunhoz9826 4 года назад +1

      i got it with tensorflow gpu v 1.13 on this week

    • @denisardelean8067
      @denisardelean8067 4 года назад +1

      Me too, I managed to make it work with v1.15

    • @Anicopedia
      @Anicopedia 4 года назад

      @@denisardelean8067 i]m sorry guy what CUDA CUDNN your use i will try it today

    • @marioxxx888
      @marioxxx888 4 года назад

      @@rafaelromeromunhoz9826
      Hello Rafael, I'm trying to Implement it, How did you generate the TF_Records?

    • @ano8929
      @ano8929 4 года назад

      @@denisardelean8067 Did you install everything as it is from step 2d?

  • @muatafaalahmid7467
    @muatafaalahmid7467 4 года назад +4

    I have made a working repo from the tutorials
    tf 1.13.1
    tf gpu 1.15
    all thanks fro Edje Electronics for the great tutorials
    github.com/mustafaazzurr/object_detection-with-Tensorflow-API

    • @jitzuzitro3305
      @jitzuzitro3305 4 года назад +1

      Good Day Sir. Can i ask a copy of your trained frozen_inference_graph of this tutorial? .. just want to compare with my trained frozen_inference_graph . Mine is slow in detecting. at what step did you stop in training? at what loss value?

    • @muatafaalahmid7467
      @muatafaalahmid7467 4 года назад

      @@jitzuzitro3305 it's slow also here, i tried the ssd v2 model and it worked way faster

    • @muatafaalahmid7467
      @muatafaalahmid7467 4 года назад

      @@jitzuzitro3305 for my dataset which contain over 1000 training images and 200 test images it took 50000 steps

    • @jitzuzitro3305
      @jitzuzitro3305 4 года назад

      @@muatafaalahmid7467 what is your graphics card sir? How many seconds/step did it take to train your model?

    • @muatafaalahmid7467
      @muatafaalahmid7467 4 года назад

      @@jitzuzitro3305 GTX1050 4gb
      around 4-5 hours

  • @diwakarraju2976
    @diwakarraju2976 4 года назад +1

    Hi @Edje Electronics, I have a problem while initialising the training
    File "train.py", line 52, in
    from object_detection.builders import model_builder
    File "C:\tensorflow1\models
    esearch\object_detection\builders\model_builder.py", line 39, in
    from object_detection.utils import tf_version
    File "C:\tensorflow1\models
    esearch\object_detection\utils\tf_version.py", line 17, in
    from tensorflow.python import tf2 # pylint: disable=import-outside-toplevel
    ImportError: cannot import name 'tf2'

  • @evandrix
    @evandrix 3 года назад +5

    num_classes: 36 (?)

  • @nguyenangthang7473
    @nguyenangthang7473 4 года назад +2

    Excuse me, when I run the protoc --python_out, there's one warning, it said ( warning: Import object_detection/protos/image_resizer.proto is unused.) what should I do with it?

    • @Armaan_Priyadarshan
      @Armaan_Priyadarshan 4 года назад +1

      nguyễn đăng thắng That probably means the command doesn’t account for all the protos you should try protoc object_detection\protos\*.proto --python_out=.

  • @coffeebean2541
    @coffeebean2541 3 года назад +1

    @Edje Electronics, I am getting error saying that the faster_rcnn_inception_v2 is not supported when running the train.py file

  • @zainabmerc5666
    @zainabmerc5666 5 лет назад +1

    Will train.py file work on every model ? I am trying to train using "faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28".

  • @shaheerkhan9542
    @shaheerkhan9542 4 года назад

    @Edje Electronics Have you any idea how to execute the custom object detection model on tf 1.x after tensorflow Up-gradation to 2.x because when I cloned the repo it generates many issues with my model?
    I already run my model but after up-gradation of tensorflow (2.x) it doesn't work properly.

  • @JonathanJMusic
    @JonathanJMusic 5 лет назад

    Hello, when I at trying to install jupyter in anaconda prompt as directed at 10:30, I get a huge error with 154 red lines in the prompt. Do you know what could be causing this and can you help? Everything else up until this point worked fine. I am using TensorFlow GPU 2.0

  • @vengateshvenki8727
    @vengateshvenki8727 5 лет назад

    I had doubt..
    Image are you using for for the training are in the same resolution or in different?
    How to export the inference graph to tflite?

  • @MetaflameDragonAlt
    @MetaflameDragonAlt 4 года назад

    Hello, how many layers is this retraining? Only the last one (I suppose)? If so, is there a config setting somewhere that unfreezes/retrains multiple layers instead of just the output one?
    I'm training an SSD Mobilenet v2 quantized network (to compile into .tflite) and after over 30k steps it still isn't nearly as accurate as I'd like it to be (on my own dataset, not cards), so I thought I could improve the accuracy by transfer training more layers instead of just the last one.
    Thanks!

  • @bmoore813
    @bmoore813 5 лет назад +2

    What a fantastic Tutorial. I love the thoroughness. :)

  • @Singh-qe3mq
    @Singh-qe3mq 4 года назад +1

    Hello, i am getting the following error when i start run the train via "python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config":
    TypeError: memoryview: a bytes-like object is required, not 'str'
    Can someone help please ?

  • @felixalbert8098
    @felixalbert8098 4 года назад +3

    Hey! I'm getting this error:
    Traceback (most recent call last):
    File "train.py", line 48, in
    from tensorflow import framework as contrib_framework
    ImportError: cannot import name 'framework'
    Can you help me with that?? (Im really not the only one)

  • @noneedtoknowthishandle
    @noneedtoknowthishandle 4 года назад +2

    Hi, I have few questions.
    1. which version of protobuf should we install if we are working with tf 2.0?
    2. Does switching between different tf versions breaks the whole configuration in current conda env where we installed all this ?
    I tried this with 2.0 but was'nt successful. I used the tf.compact.v1 as well but in when i ran train.py i threw error.

    • @alexhaler3627
      @alexhaler3627 4 года назад

      1)use 1.4 tf because tf 2.x version haven't some methods
      2)what kind of error you faced?
      You can write to me directly cause i spent 3 days to get rid of all errors and finally i got success)

    • @sjaaks3006
      @sjaaks3006 4 года назад

      @@alexhaler3627 I constantly get the following error :AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'.
      I already tried tensorflow version 1.5gpu and then i get exact the same error but it says "v1"

    • @noneedtoknowthishandle
      @noneedtoknowthishandle 4 года назад +1

      @@alexhaler3627 thank you alex for reply. I successfully trained ssd Mobilenet quantized and faster rcnn v2 using tf 1.13 GPU. I faced lot of trouble in beginning of previous week but I did it.

    • @shaheerkhan9542
      @shaheerkhan9542 4 года назад

      ​@@alexhaler3627 Have you any idea how to execute the custom object detection model on tf 1.x after tensorflow Up-gradation to 2.x because when I cloned the repo it generates many issues with new tf version?
      I already run my model but after up-gradation of tensorflow it doesn't work properly.

    • @rajmeetsingh1625
      @rajmeetsingh1625 4 года назад

      @@alexhaler3627
      please see i am using TF 1.13
      Traceback (most recent call last):
      File "train1.py", line 49, in
      from object_detection.builders import dataset_builder
      File "C:\Users\Jasgun\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\builders\dataset_builder.py", line 27, in
      from object_detection.data_decoders import tf_example_decoder
      File "C:\Users\Jasgun\Anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\data_decoders\tf_example_decoder.py", line 27, in
      slim_example_decoder = tf.contrib.slim.tfexample_decoder
      AttributeError: module 'tensorflow' has no attribute 'contrib'

  • @sadeghsenator6082
    @sadeghsenator6082 5 лет назад

    Hi, I've got another question .
    If I change parameters of faster RCNN in config file can it detect small objects???????
    What should I do to be able to detect small objects in images????

  • @mdshoaib8557
    @mdshoaib8557 4 года назад

    Idle is not working in anaconda prompt. I've installed python 3.7.3 version and in tensorflow environment idle is not working, is there any other way that i cam run the object_detection_image.py file?

  • @PaganiTypeR
    @PaganiTypeR 5 лет назад +1

    Wait... I'm confused... Why did you selected 'faster_rcnn_inception_v2_pets' config file instead of 'faster_rcnn_inception_v2_coco'?? Since you downloaded a coco model, therefore using coco config file would be an obvious thing to do, but you did it other way around... why??

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад

      That's a good question my friend... I used the pets file because that's how I did it the first time I set everything up on my own, and it worked. Since it worked, I didn't bother trying to use the coco config file. It would probably work with the coco file, you can try it if you like!

  • @okanyilmaz02
    @okanyilmaz02 4 года назад +1

    sir i have a problem , ModuleNotFoundError: No module named 'object_detection.predictors' how can i fix it

  • @mohamedtouati9663
    @mohamedtouati9663 5 лет назад

    i need to classify my dataset of car make models images files with tensorflow but i work with more then 1600 car models ? which one i should choose it as a detector ? and i should use labelimg ? or i just work with the image ?

  • @ronayusan4047
    @ronayusan4047 5 лет назад +2

    Hi! I want to create a tree detection using aerial drone pictures.... Would a training data set of around 900 images be enough? I would be annotating like 20 or more trees per image.. it's exhausting af.... would this be sufficient to get a pretty accurate detection? Thanks

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад +1

      Hi Ronello! Tree detection can be difficult depending on the situation. If you are trying to detect a tree alone in a field, it will be easy because it stands out among its surroundings. However, if you image contains lots of trees grouped together, it will have a hard time "seeing" how many trees there are. If the trees are clumped together it will probably just identify it as one big tree.
      Anyway... I would say you could start with 400 images and see how well it works, and continue adding from there. If it works decently well, add the next 500 images. If it doesn't work, you probably need to find another way to detect the trees. Good luck!

  • @lightningrider5849
    @lightningrider5849 4 года назад

    You mentioned it would be good to use newest TensorFlow but is there anyway to get this thing working on TF2.x? I have especially problems with tf.contrib that is depricated.

  • @jaketv1855
    @jaketv1855 5 лет назад +1

    Good day sir.. in tensorflow demo (tf detect) it open directly the camera right? in my project, i want to create a button right their and open a new activity (e.g MainFrame) do you know how to do it? suggestion or recommend? thanks!
    PS: my projects runs in android device and I'm creating a mobile app detection using tf detect

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад

      Hmm, I haven't looked at tf detect yet, so I'm afraid I can't help. Hope you can figure it out!

  • @GunRampage
    @GunRampage 4 года назад

    Hi , if i want to train a specific type of object (eg. water bottle), for my image do i include 2 water bottle and only label one of it in the image?

  • @manueljonaskranz6966
    @manueljonaskranz6966 2 года назад +1

    One of the cleanest videos i´ve ever seen

  • @kushagraverma9169
    @kushagraverma9169 4 года назад +1

    ValueError: faster_rcnn_inception_v2 is not supported. See `model_builder.py` for features extractors compatible with different versions of Tensorflow
    while using python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training\faster_rcnn_inception_v2_pets.config
    which tensorflow version should i use?

    • @raghavkhemka14
      @raghavkhemka14 4 года назад

      TensorFlow 1.15
      or if you want to use TensorFlow 2 use a different model which supports all.
      Check line 96 here.
      github.com/tensorflow/models/blob/master/research/object_detection/builders/model_builder.py

  • @ScytherDOTA
    @ScytherDOTA 5 лет назад

    Great tutorial, I have a question regarding the last part.
    Although Object_detection_image.py works just fine, I cant seem to make my CNN detect cars in the video.
    also, I'm running object.detection_image on multiple images (I've edited the py file with some loops) but how can I calculate the accuracy of my model?

  • @noneedtoknowthishandle
    @noneedtoknowthishandle 4 года назад

    Hi I need your help. I trained the quantized ssd mobilenet v2 model but the lose is shooting back and forth. Why is it soo?

  • @freecode.ai-
    @freecode.ai- 5 лет назад +1

    When it's identifying objects with a rectangle and threshold % is there a way to outline the identified object instead of just a rectangle around the entire object? Thanks

    • @calebvogt3469
      @calebvogt3469 5 лет назад +1

      look into a mask-rcnn.

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад +1

      That's called image segmentation! I haven't dabbled with that yet. Here's a guide that looks to be useful: missinglink.ai/guides/tensorflow/tensorflow-image-segmentation-two-quick-tutorials/

  • @arunkarthik3877
    @arunkarthik3877 4 года назад +1

    can we use ssd_mobilenet_v2_coco instead of ssd_mobilenet_v2_quantised_coco model for this

  • @RMMFeed
    @RMMFeed 4 года назад

    During the model download steps on yout updated Junpyter script I am getting errors saying the file containing the model can't be found. yet I see no place to input a file path?
    >model_name = 'ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03'
    >detection_model = load_model(model_name)
    OSError: SavedModel file does not exist at: C:\Users\.keras\datasets\ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03\saved_model/{saved_model.pbtxt|saved_model.pb}
    Also why do we do this is we already downloaded the model from the model zoo before?

  • @TomSitek
    @TomSitek 5 лет назад

    I'm running through the tutorial and getting no pictures at the end. No error messages either. I've commented out the two lines in visualization utils at lines 29 and 30 that reference matplotlib and saved the file. Am i doing something incorrect in re-running the script?
    I've tried doing rerun kernel and clear outputs then running everything again, and same result.

  • @nick-k7k
    @nick-k7k 4 года назад

    Hello, please help, when running the training command I get this error:
    File "C:\ProgramData\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow_core\core\framework\tensor_shape_pb2.py", line 112, in
    '__module__' : 'tensorflow.core.framework.tensor_shape_pb2'
    TypeError: expected bytes, Descriptor found

  • @Ellie-kv8oi
    @Ellie-kv8oi 5 лет назад +2

    Hi,
    I am stuck on the Jupyter notebook demo part of the video. I am not getting any errors and all the cells ran, but it doesn’t plot anything. I do get a warning that I am running low on memory but for the ssd_mobilenet, it should be fine right? Please let me know what might have caused the notebook to not display those plot images. Thanks!

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад +2

      Hello! Try going in to object_detection/utils/visualization_utils.py and comment out both the import statements at the top that include matplotlib. Then, try re-running the Jupyter notebook. Let me know if that works!

    • @Ellie-kv8oi
      @Ellie-kv8oi 5 лет назад +2

      Edje Electronics yes that worked and thank you so much!!

    • @coxfuture
      @coxfuture 5 лет назад

      @@EdjeElectronics thanks for being so responsive in the comments on this relatively old video! I've had the comments open for like 4 days now as I've been following the tutorial, trying to help where I can.
      I'm stuck myself at the step where I generate the TFrecords. I've done it several times with no issue but now I get
      Traceback (most recent call last):
      File "generate_tfrecord.py", line 24, in
      flags = tf.app.flags
      AttributeError: module 'tensorflow' has no attribute 'app'
      google has been no help, and I've uninstalled and reinstalled throught conda and pip several times

    • @EdjeElectronics
      @EdjeElectronics  5 лет назад

      @@coxfuture You're welcome! It makes for a nice thing to do at the end of a workday 😄. I plan to update my GitHub guide to the latest version of TF soon, hopefully that will resolve some people's errors.
      Hmm, I haven't seen that error before! Which version of TensorFlow are you working with? One general nuclear option to resolve problems is to start over and use TF v1.5 and download/use this old commit of the Models repository (which was the current commit when I made this video): github.com/tensorflow/models/tree/079d67d9a0b3407e8d074a200780f3835413ef99

    • @coxfuture
      @coxfuture 5 лет назад

      @@EdjeElectronics Answer: I'm just an idiot. i put a folder called "tensorflow" in the working directory and it was calling from there. Thanks again for your help!
      I have a long way to go still :o

  • @pikumandal9616
    @pikumandal9616 5 лет назад

    which classifier algorithm has been used for multiple object detection model by @Edje Electronics?

  • @abedachref3691
    @abedachref3691 4 года назад

    what alternative tool do i use instead of labelimg to labes non linear lines (transmission lines ) ; labelimg uses boxes which isn't helpful in my case

  • @sorpiseth6917
    @sorpiseth6917 4 года назад

    hi! I have a problem with detection.py, I try to do as your video but when I run detection (for image) the result is nothing, that mean do not have bonding box.

  • @sharadsirsat7662
    @sharadsirsat7662 4 года назад

    Edge Electronics : Hello I am trying to detect multiples images using object_detection_image.py but it gives me error "TypeError: join() argument must be str or bytes, not 'list' " What changes should I make in code so that it can read multiple images in a folder.

  • @milan_shah
    @milan_shah 4 года назад +1

    how to use this repo for the BDD100k dataset? Because the main problem is in BDD100k, all the training labels for all the training images are in a single Jason file unlike the one shown here where there is a separate .XML label file for each image!
    Thanks in advance!

  • @wd-rmf60
    @wd-rmf60 4 года назад +2

    how can i see the accuracy graph like loss graph using tensor board?
    please say me.