Install Tensorflow Object Detection From Scratch in 5 Steps | Python Deep Learning
Вставка
- Опубліковано 14 лип 2024
- Running into errors?
Tired of seeing "ERROR: XXXXX something didn't go right"
I hear you!
Installing Tensorflow Object Detection can be a little tricky at times. But it doesn't need to be. In this video we'll run through the 5 key steps you need to go through in order to setup the Tensorflow Object Detection API. We'll go from a bare install without Python to a fully setup machine.
0:00 - Start
In this video you'll learn how to:
02:21 - Install Python using Anaconda
05:51 - Install Microsoft Visual Studio and C++ Build Tools
09:01 - Install CUDA and CUDNN for NVIDIA
15:04 - Install Protoc for Protocol Buffers from the official Github Repo
18:58 - Install Tensorflow Object Detection API for use with Python
Links Used:
Anaconda - repo.anaconda.com/archive
Visual Studio - visualstudio.microsoft.com/vs...
CUDA 10.1 - developer.nvidia.com/cuda-10....
CUDNN 7.6.5 - developer.nvidia.com/rdp/cudn...
Protoc - github.com/protocolbuffers/pr...
Tensorflow Models GitHub - github.com/tensorflow/models
Face Mask Tutorial: • Real Time Face Mask De...
Face Mask Jupyter Notebook (Need to Label Images FIRST!): github.com/nicknochnack/RealT...
Oh, and don't forget to connect with me!
LinkedIn: / nicholasr. .
Facebook: / nickrenotte
GitHub: github.com/nicknochnack
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand! - Наука та технологія
You're a lifesaver my dude, exactly what I was looking for. Love the way you make it easy to understand and go through step by step
Anytime @Sharveen, so glad it was useful!!
@@NicholasRenotte Real lifesaver, if I wait for my school to reply my email on this issue, i believe i will 100% fail my course
Thanks for this clear and straightforward tutorial! Great work
Thanks so much @Matthäus 🙏!
Even though video is half an long but installing all the others file will take more than double the time of the video. However is simple enough such any one can perform or install . Thank you for making such good video
you are a legend man. Keep up the great work.
Thanks so much @Efe, definitely!
Greetings sir! Thank you very much my training is now working using GPU. I am having a hard time searching. I switch from windows to linux then go back to windows. I have encountered issues with the cuda then I have read your comment downgrading from tf 2.4 to 2.3.1 solves my problem. Right now I am doing real time sign language recognition system that involves basic words and phrases in FSL. Again thank you very much for making this video . Please stay safe and God bless your family sir
Thanks so much @Mark!! Glad you got it up and running!
The instructions were super easy to follow. This video saved me days of research time of how to get this up and running.
I was able to make it work in 1.5 hrs.
Great content as always! Thank you!
Thanks a billion @Dan 🙏🙏!
Please Help to resolve this issue.... it occurs at 23:10
during running command python -m pip install .
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python38-32\python.exe' 'C:\Python38-32\lib\site-packages\pip' install -ignore-installed --no-user --prefix 'C:\.......\pip-build-env-s04_mitd\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i pypi.org/simple - wheel setuptools 'Cython>=0.29.2' 'numpy==1.13.3; python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.5'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"''
cwd: None
Complete output (31 lines):
Traceback (most recent call last):
File "C:\Python38-32\lib
unpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python38-32\lib
unpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Python38-32\lib\site-packages\pip\__main__.py", line 26, in
sys.exit(_main())
File "C:\Python38-32\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\Python38-32\lib\site-packages\pip\_internal\commands\__init__.py", line 105, in create_command
module = importlib.import_module(module_path)
File "C:\Python38-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Python38-32\lib\site-packages\pip\_internal\commands\install.py", line 17, in
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "C:\Python38-32\lib\site-packages\pip\_internal\cli
eq_command.py", line 23, in
from pip._internal.req.constructors import (
File "C:\Python38-32\lib\site-packages\pip\_internal
eq\__init__.py", line 10, in
from .req_install import InstallRequirement
File "C:\Python38-32\lib\site-packages\pip\_internal
eq
eq_install.py", line 10, in
import uuid
File "C:\Python38-32\lib\site-packages\uuid.py", line 138
if not 0
@@HaiderSafdar hmmm, not too sure about that error but it looks like it's to do with UUID on AIX. What do you get if you run pip install uuid?
@@NicholasRenotte when i ran pip install uuid it gives already satisfied..installed..
i have problem with installation of pycocotools it's they are necessary to run with this.
@@HaiderSafdar A bit late, but maybe it helps other peeps. uuid comes budled with Python starting at version 2.5 and it should not be installed separately. People report that after uninstalling it (pip uninstall uuid), things would work fine.
Thank you and take a lots of love brother. Keep doing this great works.
Thank you sooo much @Sudipta! 🙏
Thank you so much. This video is a live savior from that nasty error
tutorial for 2024 versions pls
Tried it, according to the website guide and chatgpt, a lot of errors so far, I am having zero success in setting them up.
This is a great video. For those who have experienced the 'cudart64_110.dll' error, its because you are installing Tensorflow 2.4.1 so the cuda and cudnn versions must be updated. This is the easiest way I think:
1. Activate your conda object-detection environment - 'conda activate name_of_env'
2. Issue 'conda list' command and check Tensoflow, cudatoolkit, and cudnn versions. If its tensorflow 2.4.1 the cuda stuff is probably not listed.
3. For Tensorflow 2.4.1 you will need cudatoolkit 11.0.3 and cudnn 8.0.5.39
4. If cudatoolkit and cudnn are installed, but with lower versions, you will need to remove them
a. conda remove cudatoolkit
b. conda remove cudnn
4. Install from the nvidia conda channel
a. conda install --channel nvidia cudatoolkit=11.0.3
b. conda install --channel nvidia cudnn=8.0.5.39
5. Close your terminal session, then open a new one, go to your environment and test your install.
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000,1000])))"
6. The first line of output should be:
2021-02-16 19:55:16.628819: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
With this, I am able to run different versions of cuda in different environments.
Awesome work @Alvaro, thanks for sharing!
Hey, I got this error: PackagesNotFoundError: The following packages are not available from current channels:
Additionally, the cudann & cudatoolkit versions Nicholas mentioned in his video do not appear in 'conda list' and have to be removed under add or remove program in windows
I googled and found this to be the correct command for installing instead:
conda install -c anaconda cudatoolkit
i did not install cudann to a newer version, and testing with your code with line 5 gave me the sucessfully opened messages, and a final output:
tf.Tensor(100.03393, shape=(), dtype=float32)
@@brokeunistudent2474 hmmm, are you using conda install or pip install?
@@brokeunistudent2474 That's because you haven't added the nvidia channel to anaconda. But as long as it works, right.
@@brokeunistudent2474 Also, to add a channel do the following:
conda config --append channels nvidia
I like using the nvidia channel because I know that I'm getting the latest official packages
Thanks for this Life Saving tutorial ❤... I was having a hard time while watching your video of sign language translation but this tutorial solved my problem
OMG so I haven't finished watching this but if this works you are an absolute legend! I spent a fair while trying to install it and following all these tutorials and got so mad grrrrrr just want to test my idea before I keep downloading tens of thousands of images. Will comment back. I'm on the Sunshine Coast btw, cool to see you're in Sydney!
Works great! Thank you!
YESSSS, awesome work @Joel! Oh yess, I'm coming up to Brizzy soonish. Will need to catch up for a beer or two!
@@NicholasRenotte dude I'd be super keen actually. I'll contact you through FB/LinkedIn. My background is as a chemical engineer but looking to move into software dev. Your videos are easily the most helpful on computer vision, thanks heaps.
@@Joel-if2bg yesss!
For some reason the ls command is not working for me, I have tried adding git bash bin to path and its other folder but it still is not working niether is the cp command
Hey @Nicholas,
I've tried multiple times and it always says "Failed building wheel for pycocotools" when I start the installation. Any idea what the issue might be?
Heya @kartik, is there a broader error?
I do have the same error and am still trying to solve it. @kartik 1819 did you find a solution?
@@michaels8371 Same here, any of you got anything?
Same :(
you are saving lives, maan ♥
my laptop is detailing HP core i3 8th gen 8GB ram 256GB SSD and NVIDIA GeForce MX110. that can support?
ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml'
HELP :S
Just a comment for your UA-cam algorithm ;)
YEAHHHYA Thanks @Diego!
keep on, very well explaned
thank you so much, excellent content!
Thanks a ton @Nelson!
Hey Nicholas, thanks so much for this video.
Nicholas, I have a problem during the installation. I'll try to explain you. Before to install the TensorFlow Object Detection, I've installed the TensorFlow 2.1 by source, due to the Compute Capability of my graphic card. When I've installed the TensorFlow Object Detection, my TF version was changed into 2.6, this version requires other CUDA configurations. I've reinstalled the TF 2.1 to run with CUDA, but the Object Detection API does not work. Do you have any suggestion to this issue ??? Because I tried many times, but without success. Thanks you for all your videos, this help-me a lot.
Would ideally be looking at using TF 2.3.1 at a bare minimum and using the associated CUDA/cuDNN installs.
Hi @Nicholas, thank you for this content. That is the most straightforward tutorial about this topic.
I have a question. I have followed all instructions step by step of your video, and everything was working just fine, but then...in the minute 23.14, when you run the tensorflow installation code (python -m pip install .) I am getting a bunch of errors related to opencv.
These are some of the errors I am getting:
the error message is gigantic, but I think the most important line is this: ERROR:
"Could not build wheels for opencv-python, opencv-python-headless which use PEP 517 and cannot be installed directly"
What do you think it is happening here? and waht are the possible solutions for this?
Thanks for the great job, man.
I'm having the same problem. Does anyone know how to fix this please?
Same
yes same error.Suggest a way to fix this
Sí, el mismo error.
same
Hi @Nicholas, have another question:
You mentioned in your tutorial a UA-cam folder by the minute 24:16, within you install Jupyter and run a tutorial.
I am not sure if I have understood this part correctly.
Is the UA-cam folder and the Jupyter tutorial installed altogether with the python -m pip install . command??
Thanks again
Thank you soo much mate:)
Hi Nicholas,
I know this issue has been mentioned several times in the comment section but I tried a few things and it still doesn't works for me, so I was hoping for your advise on this.
I think you made an error file to address such issues, but here I even tried chaging gfile to tf.io.gfile wherever it was there in the code but didn't help much.
It could be due to the version of tensor flow 2.6.0 but I am not sure
how to downgrade or whether that is the main issue or not, and if I try
downgrading then which steps will I have to repeat from the setup?
But, while this (-m install pip .) ran I got a number of errors, I didn't record them, most were yellow meaning asking to update the version and few were red (I don't remeber what the errors were, now).
Anyhow, went ahead and ran Tutorial file in jupyter notebook, and at 2.Create TF records ,
I got the following error :
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 61, in
label_map = label_map_util.load_labelmap(args.labels_path)
File "C:\Users\XXXX\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 61, in
label_map = label_map_util.load_labelmap(args.labels_path)
File "C:\Users\XXXX\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Finally got stuck here and couldn't continue further, please suggest something for this situation
Once you've swapped out tf.gfile to tf.io.gfile. Restart your environment and reimport.
@@NicholasRenotte nvm I tried a lot, but I'm just a beginner and I don't understand a lot of things.
I'm quitting on this one..
Thanks for such an amazing step by step explanation ☺️ But sir while training my model it's still using CPU (100% usage)instead of GPU(0% usage) and I am unable to figure it out😅 so can you help why is this happening ?? I have followed each and every step according to the video.
Thank you 😊
Heya @Harsh, that doesn't sound quite right 😅! Let's dig into it:
1. When you start your training does it identify your GPU? And sucessfully load cudnn and cudart?
2. Are you using an nVidia GPU?
3. Did you install the TF versions using the object detection package? Did you have tf installed previously
@@NicholasRenotte
1. How can I know if identifies the GPU and load cudnn and cudart?
2. Yes Nvidia Geforce GTX 1050
3. I had tf installed previously but I did follow the 5th step(Install Tensorflow Object Detection API for use with Python) and did everything same.
On installing Cuda at the finishing step I get this message
{The installed version of Nsight Visual Studio Edition is newer than the one to be installed. To reinstall, or change the Nsight configuration, first uninstall Nsight and then reinstall.}
@@vaibhavchotani6059
1. You should see a line like this when you start training: ua-cam.com/video/dZh_ps8gKgs/v-deo.html
2. Looks like that GPU is fine: www.nvidia.com/en-us/geforce/forums/geforce-graphics-cards/5/251179/gtx-1050-and-cuda-8/
3. Did you get any errors after triggering the install?
Hmm, possibly uninstall Nsight and reinstall as part of your CUDA setup? Did you have Visual Studio already installed?
Hi @@vaibhavchotani6059. May be it not actually for you, but for me help:
1. Reinstall driver for gpu card (last version)
2.Downgrade tensorflow-gpu version up 2.4.1 to 2.3.0
Check for logs, if it is saying could not load cudart64.dll then your GPU is not being detected , to resolve that you have to install compatible versions of Tensorflow and Tensorflow-GPU.
i didnt know this existed ... god! thanks brother
Hi! I am currently using windows 11, what CUDA and CUDNN version do you recommend to download? Thank you
hi can you help me, im stuck in step 6 when i need to train the models it give me this error
W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
i already install the cuda and cudnn,
but weirdly on step 2 my tf record both train and test is empty
Successfully created the TFRecord file: Tensorflow/workspace/annotations/train.record
Successfully created the TFRecord file: Tensorflow/workspace/annotations/test.record
Heya @Eldridge, let's dig into it. This looks like you might be using a newer version of Tensorflow as it's lookng for CUDA 11 rather than 10.1. There's two things you can do, downgrade Tensorflow to 2.3.1 or install CUDA 11! I haven't tested the tutorial on tf 2.4.0 though.
@@NicholasRenotte yeahh i manage buy upgrading to cuda 11 and cudnn 8. something, it works!, by the way im trying to create 3rd labelling which is incorrect, but it doesnt work that well, do you have any suggestion? i change the labelling already and label the image as nomask mask and incorrect.
@@eldridgerexroy awesome! Is it just not performing or you're getting errors?
@@NicholasRenotte not performing, it detect only no mask and the other is not displaying, i use 70 images, 50 train 20 test
@@eldridgerexroy hmm, how many in each training class? If I divide 50 by 3 that's only ~17 images per class. You could try adding a bunch more images and train for longer!
I have followed each and every step but still encounter errors
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 61, in
label_map = label_map_util.load_labelmap(args.labels_path)
File "C:\Users\baigj\anaconda3\envs\tensorflow1\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 61, in
label_map = label_map_util.load_labelmap(args.labels_path)
File "C:\Users\baigj\anaconda3\envs\tensorflow1\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
I changed tf.gfile.GFile to tf.io.gfile.GFile
then is it showing some other error like
Object Detection Api TypeError: Expected binary or unicode string, got .....
Please help..
I'm loosing my patience.. :-|
Have you installed from scratch? So fresh install of Python etc?
@@NicholasRenotte yes i have installed everything from scratch
@@javedbaig6563 can you check what version of Tensorflow you are using? Run this inside of a notebook:
import tensorflow as tf
print(tf.__version__)
@@NicholasRenotte 2.3.1
im encountering the exact same error. Could you solve it?
OH MY GOD YOU ARE A SAVIOR !!!!!!!
finally done with the install
YESSS!
Great content, but I am having major compatibility errors when executing "python -m pip install"
Thanks @Reece, what's the error!
@@NicholasRenotte It appears that I have now installed it correctly, but when I am trying to update Config for transfer learning "config = config_util.get_configs_from_pipeline_file(CONFIG_PATH)" I get this error "NameError: name 'config_util' is not defined"
@@reecemoon8639 might have missed an import there. Double check you ran this cell after step 5. (config_util is in the second line):
import tensorflow as tf
from object_detection.utils import config_util
from object_detection.protos import pipeline_pb2
from google.protobuf import text_format
Hi sir ,can you please help me with the code to convert this video model (Real Time Sign Language Detection with Tensorflow Object Detection and Python | Deep Learning SSD) to tflite as i tried reading the documentation but was unable to convert it.
I read the documentation but still wasn't able to convert it
Please help me in this 😊 and the quality of the videos are too good 🔥 .
Heya @Harsh, I think i might do a tflite conversion video this week. Is the plan to deploy to a mobile device?
Thank you Mr for clearing the doubts
🙏🙏Great fun 👍👍
Anytime @Dhruv, tackling tf installation can be a nightmare, thought I'd try to clear it up!
Thanks have been expressed in the graduation thesis --- college students from China
Awesome work guys!! What was your thesis on?
@@NicholasRenotte Target Detection Based on Jetson
This what stack me in the middle of ur tutorial. Please help me
D:\models
esearch>cp object_detection/packages/tf2/setup.py .
'cp' is not recognized as an internal or external command,
operable program or batch file.
Heya @Mirkena, try changing cp to copy and changing all the forward slashes to \\
"copy object_detection\packages\tf2\setup.py .", this should probably work
Install Git bash then it would be work
Thank you for this amazing tutorial im just stuck at the last step where you copy the setup.py
Tried to write copy but i had an error so i downloaded git bash and tried cp and that also did not work so i tried doing it in powershell it worked but there was some issues when i did the python pip install some libraries had issues like tensorflow 2.6.0 has requirement six~=1.15.0, but you have 1.12.0 which is incompatible and many others like this. Is this an issue because i used powershell?
Shouldn't be, stick to copy by ensure all / are \ when calling from PS.
@@NicholasRenotte thank you the object detection got installed but im having an issue with the TF records it does create records but they are empty and gives such an error
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 168, in
tf.app.run()
File "C:\Users\SAYTECH\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\SAYTECH\Anaconda3\lib\site-packages\absl\app.py", line 312, in run
_run_main(main, args)
File "C:\Users\SAYTECH\Anaconda3\lib\site-packages\absl\app.py", line 258, in _run_main
sys.exit(main(argv))
File "Tensorflow/scripts/generate_tfrecord.py", line 158, in main
tf_example = create_tf_example(group, path)
File "Tensorflow/scripts/generate_tfrecord.py", line 132, in create_tf_example
classes.append(class_text_to_int(row['class']))
File "Tensorflow/scripts/generate_tfrecord.py", line 101, in class_text_to_int
return label_map_dict[row_label]
KeyError: 'hello'
I am facing the same problem how can I resolve it?
@@rashmitiwari6490 which problem exactly? The TF records one or the copy of setup.py?
Setup.py problem
Worked perfectly (no gpu). Thank you very much
Hello friend, did you install the protocols?
@@juancarloschizallambo6955 Yes, I just don't have any gpu on my machine that's why I mentioned (no gpu)
Did anything change for you in terms of the installation and setup? ...or did you follow the video instructions in the same fashion? I ask because I do not have a GPU on my machine
@@oneshellconsulting3931Hello friend I tell you to install all the steps except GPU what you will observe is the processing speed when the system trains it is not so fast it is slow but it goes well
@@oneshellconsulting3931 Hello, you just need to skip the CUDNN part, on my machine with a GPU, I had to add the CUDNN part, but on my laptop without any GPU, I just skipped it. But training an object detection network without GPU can take a loooonnnnng time. Use transfer Learning as much as you can :]
@22:15 "D:\models
esearch>copy object_detection/packages/tf2/setup.py ."
the code of copying is giveing me a syntax error: The syntax of the command is incorrect.
installed gitbash and trie it with "cp" instead of "copy" still got the same error
any idea what am i doing wrong?
Can you do the same for MacOS pleaseeee?
I've been doing a research project and been stuck with an error since the last week! Nobody is really doing/teaching it on Macs.
from object_detection.utils import dataset_util, label_map_util #this is line 30
Traceback (most recent call last):
File "/content/generate_tfrecord.py", line 30, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
I've tried changing the path in the terminal and a lot more following the threads, but I really cannot solve this issue. If someone can help me, I'll be really thankful!
MacOS Catalina 10.15.3
Doing it on Google Collab
Heya @Siddarth, just checking are you running the code on Jupyter on the Mac or in Colab?
@@NicholasRenotte Collab on the Mac... but I’m getting a PIL error in Jupyter
@@NicholasRenotte I have changed the path, installed dependencies but I'm still getting errors.
I have been stuck with this since a week, and need to submit this project (and paper) by the weekend... Can you please help me?
(Maybe we can have a call)
@@sid4752 sure, what errors are you seeing now?!
@@NicholasRenotte Hey Nick, thank you so much for getting back to every message of mine my man.
I’ve heard that there are issues in general with object detection api for MacOS. (In their website they only mentioned Windows/Linux, I should’ve noticed that first).
So, I actually left that project and worked with Keras and CNN, and I now have a model with 99% accuracy, which is perfect for my research project.
Can you make your further videos using MacOS or a Linux environment? (As windows is pretty straightforward to follow anyway)
God bless you and your work! 🙏
I can’t believe you’re replying to every message and helping us learn! Thank you!
(And has anyone told you, you look like Chris Lynn? ;) )
I m going through all your object detection videos , like the mask one and also hand sign , the next major step is to deploy this model using fastapi in AWS EC2, for real time detection , wouldn't that be amazing
Yah, just added FastApi to the list!
Hi thanks for the video, I had to use absolute paths in order to get it to work, just in case some one gets issues using the jupyter notebook
Thanks so much @Ronald, awesome for sharing!
I am having problems Please explain more
@@MS-rw3rh heya, want to share what's happening?
@@NicholasRenotte My terminal shows this: ' None of the MLIR optimization passes are enabled'. I am stuck. It is not letting the model train. In your video, it shows a loss. I have been waiting for 2 days. Please help me.
Thank for training!
cp object_detection/packages/tf2/setup.py . is not recognized file program. i got it .. How to solve.. please help me
me too :')
Just copy it manually, if the command doesn't work can just manually copy my guys!
@@NicholasRenotte Yes I followed your video on how to install step - step.
I was able to make it work in 2 hrs. but still, error and can't.. 😓
please, you will upload to again Install Tensor flow Object Detection From Scratch in 5 Steps | Python Deep Learning" 2022
If there are problems by using "cd object_detection/packages/tf2/setup.py ." Use "copy object_detection\packages\tf2\setup.py ." Use \ Instead of /. This should Work!!
Thanks for sharing!
Hi, Nick. Great work thank you bringing us this quality videos. I was just watching your ''esrgan' video and had to check this one first for cuda and stuff. I have a question: should i have a Nvidia gpu for coda? and if answer is yes, what is the alternative? Thank you again, great content.
Yep, if you're getting into deep learning I highly recommend a NVIDIA GPU, there's nothing else that really works as easily atm. You could look at AMD GPUs (a pain to setup though) or consider a cloud service like Colab!
Thanks a lot
hi nicholas, I'm facing a problem at the final step "python -m pip install ." throwing an error "ERROR: Could not install packages due to an OSError: [WinError 206] The filename or extension is too long", Can you help me resolve it :)
Really great video and simple yet straight to the point, just wanted to ask by any chance if my GPU is AMD what is the alternative for CUDA and CUDNN
I haven't tested it out but it should be tensorflow-rocm which leverages AMD acceleration.
Thanks for the clear instruction well appreciate hints I had these errors in step 5
ERROR: astroid 2.2.5 requires typed-ast>=1.3.0; implementation_name == "cpython", which is not installed.
ERROR: apache-beam 2.28.0 has requirement avro-python3!=1.9.2,=1.8.1, but you'll have avro-python3 1.10.2 which is incompatible.
ERROR: lvis 0.5.3 has requirement matplotlib>=3.1.1, but you'll have matplotlib 3.1.0 which is incompatible.
ERROR: lvis 0.5.3 has requirement numpy>=1.18.2, but you'll have numpy 1.16.4 which is incompatible.
ERROR: tensorflow 2.4.1 has requirement grpcio~=1.32.0, but you'll have grpcio 1.36.1 which is incompatible.
ERROR: tensorflow 2.4.1 has requirement numpy~=1.19.2, but you'll have numpy 1.16.4 which is incompatible.
ERROR: tensorflow 2.4.1 has requirement six~=1.15.0, but you'll have six 1.12.0 which is incompatible.
ERROR: google-api-core 1.26.1 has requirement six>=1.13.0, but you'll have six 1.12.0 which is incompatible.
ERROR: google-api-python-client 2.0.2 has requirement six=1.13.0, but you'll have six 1.12.0 which is incompatible.
ERROR: tensorflow-metadata 0.28.0 has requirement absl-py=0.9, but you'll have absl-py 0.12.0 which is incompatible.
Hmmm, was there a larger error @A.Z A.Z.?
@@NicholasRenotte
NO I haven't see any other big errors
I will repeat the steps again step by step :)
I will update the comment if I had the same error :)
Thanks for your answer
@@a.za.z1445 anytime, let me know how you go!
A great Video again! If i am Building an executable , do i need all that requirements on every PC i want to use that executable on?
At 20:10 should we navigate to D drive or we can also paste the clone model with out navigating to D drive
Great content!! I'm now setting things up, but I would like to know what you recommend for these ERRORs:
ERROR: astroid 2.2.5 requires typed-ast>=1.3.0; implementation_name == "cpython", which is not installed.
ERROR: httplib2 0.19.1 has requirement pyparsing=2.4.2, but you'll have pyparsing 2.4.0 which is incompatible.
ERROR: pyarrow 4.0.1 has requirement numpy>=1.16.6, but you'll have numpy 1.16.4 which is incompatible.
ERROR: apache-beam 2.32.0 has requirement avro-python3!=1.9.2,=1.8.1, but you'll have avro-python3 1.10.2 which is incompatible.
ERROR: lvis 0.5.3 has requirement matplotlib>=3.1.1, but you'll have matplotlib 3.1.0 which is incompatible.
ERROR: lvis 0.5.3 has requirement numpy>=1.18.2, but you'll have numpy 1.16.4 which is incompatible.
ERROR: sacrebleu 2.0.0 has requirement numpy>=1.17, but you'll have numpy 1.16.4 which is incompatible.
ERROR: tensorflow-metadata 1.2.0 has requirement absl-py=0.9, but you'll have absl-py 0.13.0 which is incompatible.
ERROR: tensorboard 2.6.0 has requirement google-auth=1.6.3, but you'll have google-auth 2.1.0 which is incompatible.
ERROR: tensorflow 2.6.0 has requirement numpy~=1.19.2, but you'll have numpy 1.16.4 which is incompatible.
ERROR: tensorflow 2.6.0 has requirement six~=1.15.0, but you'll have six 1.12.0 which is incompatible.
I'm not sure if it's because I had installed some of these things before. NOTE: - Protoc version changed (3.18 instead of 3.14); for the rest I used the recommended.
What version of Python are you using? Suggest 3.7.3 for a stable implementation when using the versions of libs I recommend in the vid.
@@NicholasRenotte That's the one I'm using! I followed the rest of the steps and managed to develop the detector (SLR system), but still not sure if everything is working as it should.
For example, is there a way to determine whether my GPU is the one performing the job? (By code, I'd say)
General question: Is there some instruction to see a list of the layers used by a model or should I look for that information within documentation?
Thanks for answering and for your dedication!!
Hi, in 2.07 I cannot use the cp or copy command it give me syntax error for "copy" and it cannot recognize "cp"
Great video!!! Helped a lot! I saw ur comment about TTS API for audio output..Where and how do we get this and where do we include this in jupyter?
Check this out @Hrianmayi: ua-cam.com/video/8k8S5ruFAUs/v-deo.html
hello nicholas, is it necessary for me to check the tensorflow works or not like you did on your facemask project? and i dont have the image collection files
Double check the file path! Ensure you've got a collectedimages folder as well!
Hi Nick, I encountered an error later down the road in the tutorial.ipynb...
Also, how I use it in phycharm? when the interpreter asked me what is the file path for tensorflow.
in the 4.Copy Model config to training folder:
A subdirectory or file Tensorflow\workspace\models\my_ssd_mobnet already exists.
'cp' is not recognized as an internal or external command,
operable program or batch file.
5. Update config for transfer learning
it allows me to go through, and up to In [11]:
NotFoundError: NewRandomAccessFile failed to Create/Open: Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config : The system cannot find the file specified.
; No such file or directory
did i screw up on git bash or what was the problem?
thanks,
Dan
Heya Daniel, yah weird, if you've got GitBash installed then cp should work. Can you manually copy pipeline.config from the pre-trained model folder into the my_ssd_mobnet folder?
@@NicholasRenotte unix command only work if you select to install unix option when you install gitbash, i think its the last choice below the recommended
Thanks @@eldridgerexroy LEGEND!
legend
Hi Nicholas, you know that this video has got outdated, but is really helpful in terms of what applications to install sequentially. Can you atleast share what versions of all the applications above needs to be installed today for the latest TF OD?
Hmmm, what makes you say it's outdated, as in the version of Tensorflow?
@@NicholasRenotte Yes the version of Tensorflow. You see after installing the setup.py , and again dowgrading to Tensorflow 2.3.1 doesn't actually make it work properly as you recommended in some comment before.
Hence, I request you to share all the compatible versions of Anaconda, CUDA, CUDA_DNN, etc. for the latest version of Tensorflow 2.4.1
These versions of the softwares used in the video no longer are compatible for installing TF 2.4.1.
@@binayakpanda5749 Is their a solution. I have the issue that it doesn't work this way.
Hi Nicholas , thank you for this video ,, I have error in python -m pip install the error is ERROR: Could not build wheels for opencv-python, opencv-python-headless which use PEP 517 and cannot be installed directly what i have to do ,, can you help me
Thanks for this detailed how to set up things video. i have a question. New versions of protoc has been released after you published this video. What should we install? Same version what you suggest or latest one?
Haven't come back to this in a while, try using the same one described in the tutorial! Going to be redoing the OD tutorials soon!
Help!
I'm not sure what protocol buffer to currently download since there are new ones since you uploaded this video.
I'm using windows
please help! i get the following: AttributeError: module 'tensorflow' has no attribute 'gfile' . I did exactly the same you did. I have Python 3.7
Ney Nicholas, when I'm trying to run the setup.py file, I get the following error:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'e:\\anacc\\lib\\site-packages\\~5py\\defs.cp37-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
Waht might be wrong? The command prompt is open in admin mode.
Hi Nicholas,
I am doing this same topic for my project
But the problem is I don't have nvidia gpu in my system, it has Intel r hd graphics 5xx, will this still work on my system.
I heard installing TensorFlow-directml package will solve the problem but will their be any changes that has to be made in the code.
Hi there for visual studio 2022 which versions of cuda and cudnn should be used.
sir, while I was downloading the tensor flow API some of the commands are displaying errors in the command prompt...how can I solve that???
is the installation for cuda and cudnn important if so i have amd radeon (ryzen) 5 so what should i need to download
I managed to do this with tensorflow 2.4.1. And the tested nvidia cudatoolkit is 11.0, and cudnn 8.0.4. I didnt find a way to downgrade to tensorflow 2.2.0 so I just let the installation update into tensorflow 2.4.1, as the installation of the object detection API using pip, will update everything required. GPU acceleration should work with tensorflow 2.4.1 and these cuda and cudnn versions.
cuda_11.0.2_451.48_win10
cudnn-11.0-windows-x64-v8.0.4.30
I just pip installed pycocotools-windows==2.0.0.2 seems to work thus far, even Nick's later tutorial about tensorboard metrics.
I used efficientdet_d0_coco17_tpu-32.
Great vids by Nick I gota admit! youre a good teacher.
Thanks so much @Lauri, what kind of performance did you get with Efficient Det? Also, seen the new vid yet?
Hi Nicholas, I'm installing tfod in Nvidia Jetson Nano which uses Debian os. Therefore I'm using VSCode. I want to know how can I install Visual C++ build tools using VSCode.
while installing in the last step while copying the setup.py in my windows machine it is showing wrong syntax i am using the comand same as you told with using copy instead of cp but still not working
oops
Nicholas Renotte, I follow your videos here in Brazil and I'm aiming to build a project with mtensorflowlite and use it on android, but the fps is very low in object recognition in video. Do you have any idea how to improve this fps? It cost.
@Nicholas Renotte
I have the same specifications as yours but my system does not run on GPU for training. its rather showing that cudaart64_110.dll . I have 10.1 . Help me please to solve this error.
Heya @Bro, this is possibly because you're using Tensorflow 2.4.0 instead of 2.3.1. You can either install CUDA 11 and the matching CUDNN version or downgrade Tensorflow to 2.3.1.
And also update video card driver
Hey! Do you think I can download the latest proctoc (proctoc-3.17)? or should I stick with proctoc-3.14?? Thanks!
I picked up the latest one in my most recent tutorial and didn't have any issues @Moe!
Hi Nicolas, I was having issues in using Tensorflow earlier, So I uninstalled everything related to python and anaconda from my laptop and followed your steps from the video twice, yet getting some errors while creating the TF records.
I am using the code from the sign language recognition video.
Following is the error that I am facing. Can you please help
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 168, in
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "C:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "Tensorflow/scripts/generate_tfrecord.py", line 158, in main
tf_example = create_tf_example(group, path)
File "Tensorflow/scripts/generate_tfrecord.py", line 132, in create_tf_example
classes.append(class_text_to_int(row['class']))
File "Tensorflow/scripts/generate_tfrecord.py", line 101, in class_text_to_int
return label_map_dict[row_label]
KeyError: 'Thank You'
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 168, in
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "C:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "Tensorflow/scripts/generate_tfrecord.py", line 158, in main
tf_example = create_tf_example(group, path)
File "Tensorflow/scripts/generate_tfrecord.py", line 132, in create_tf_example
classes.append(class_text_to_int(row['class']))
File "Tensorflow/scripts/generate_tfrecord.py", line 101, in class_text_to_int
return label_map_dict[row_label]
KeyError: 'Thank You
Hi Nicholas , tried installing TFOD using offical documnet on 30 - 11 - 2021 .
1) till cocotools setup every thing is fine
2) but when comes to install object detection its not getting install
I followed Everything step by step but not sucessful in installing need your help .
I would be really helpful if provide solution for current version
You deserve a nobel prize. period.
And when i want to install cuda, it says that no supported version of visual studio was found. I've already installed a the Microsoft visual Studio as mention in 2nd step but still..
Nice tutorial, Nicholas. Quick question. Why is command prompt needed as an admin? If Anaconda is installed for a local user, how can a command window that's run as an admin connect to an Anaconda's python environment?
Hi @Vijay, the short answer is it's not, I just do it to ensure I have it across my PC and so that it is added to my Path.
at 23:14 when i run (python -m pip install .)
This error occurs so how should it be solved pls help....
cl : Command line warning D9025 : overriding '/MD' with '/MT'
sentencepiece_wrap.cxx
src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> sentencepiece
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Did you solve the problem?
Still trying.. to resolve the problem.
Hey Nick! I am trying to implement the real time ASL detection program. I have installed tensorflow according to the instructions shown in this video. But when i reach the "import tensorflow as tf" stage in the jupyter notebook, it shows error: No module named 'tensorflow'. I cant seem to find a fix for this. Any help is much appreciated
any resolve?
From the training process, can we see the weight and bias results for each layer that will be used for test data?
Hey Nicholas, this is a great tutorial ! but even tho i alr install gitbash, i can't run cp in my cmd. do u know how to fix this ? thank you
i am having a problem in building wheel for opencv-python (pep 517) while installing tensorflow
Hello Nicholas,
I am glad to see that you are growing so fast. I believe you are a hidden gem for whose interested in Ai.
I have a real quick question that, I want to disable the confidence percentage is shown on each bounding box. How can I deal with that?
Best,
I am leaving like on your other videos to break youtube algorithms...
Update: I was able to figured it out. All i needed to add "skip_scores=True" into viz_utils.visualize_boxes_and_labels_on_image_array function. In case anyone needed.
I want to hide it because some people think that it is a possibility of the bounding box rather it's just a softmax output.
my next task is to generate coordinates from predicted images and crop the bounding boxes.
Yessss! Awesome work @Mike, thank's for that tip btw. So you're cropping to a region of interest as well? Got a mega tutorial on OD coming up, 🤞 you'll enjoy it. I'll talk a lot about performance tuning and deployment as well!
@@NicholasRenotte Actually I was going to crop it but then my advisor professor advised me to extract the coordinates to csv file only. But I am excited to watch your tutorial about cropping ROI. Keep up with good work. I love watching you. Thank you for everything.!!
Thank you for the video. I already have python(v. 3.9) installed using pip, should I install anaconda or am I good to go?
Would suggest using 3.7.3 or 3.8.x, looks like 3.8 is recommended in the docs: tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html
hey there ... when i downloaded anaconda , python version was 3.8.3 is that will make any change
Hey man,
Could you help with the lastest cuda and cudnn versions for windows 11? really trying to figure out how to do that, but its just a mess...
models
esearch>copy .object_detection/packages/tf2/setup.py .
The system cannot find the file specified.
The file is there but I can not fix this error. Could you please help? (23:00 in the video)
There's a leading . in your command @Mehmet, you've got this:
copy .object_detection/packages/tf2/setup.py .
But it should be this:
copy object_detection/packages/tf2/setup.py .
@JONATHAN MOGOVAN can you try this, assuming you're running on windows yah? copy object_detection\packages\tf2/setup.py .
i got Getting requirements to build wheel did not run successfully. what can i do to resolve this? this is when i tried to do the last command in tensorflow install
would I still be able to do the face mask tutorial if I somehow did not manage to use the GPU for my tenserflow installation? I somehow receive a Blas SGEMM when copy pasting the code lines from the tutorial jupyter notebook which apparently means that they are fighting to use my GPU, or something like that but I did manage to read all the cuda files. I just would like to proceed learning your tutorial on the mask object detection. Thank you!
Heya @izzrose1997, yep you sure could it would just take a little while longer to train!
Hi, is Cuda 11.5 compatible with tensorflow object detection API? I use windows 11 and i can't download Cuda 11.2.
If i use visual studio latest version, do i need to use latest version of python as well?
Thx for the video. Now the git clone tensorflow model will prompt to install TF2.7. The training still works with CPU but not GPU because TF2.7 requires cuda 11. I downgraded to TF2.3.1, the training failed. I have one question, CPU only affect the time neede for training right? Does it also affect the result or the accuracy of the training? And i have a GTX 1050TI, which cuda version should i use?
Excellent content My Master, i have some issue in a session Install Tensorflow Please
copy "object_detection/packages/tf2/setup.py" .
The system cannot find the file specified.
0 file(s) copied.
Thank You so much 🙏
Thanks for the great video. Any reason not to install the newest Anaconda?
Nope, go for it. Just make sure the version of Python is compatible, I've just found 3.7.3 works best.
Hey Nicholas, I get the following error when I try to train my model on prompt -
ImportError: cannot import name 'model_lib_v2' from 'object_detection' (C:\Users\MyName\AppData\Roaming\Python\Python37\site-packages\object_detection\__init__.py)
Thing is its looking for model_lib_v2 in my C drive but its available on the object_detection folder on my D drive which is what I changed directory to in order to run the training. I followed your installing video step by step.
Thanks for this great content! I am doing the hardhat detection project with these tutorials can u suggest to me what else can I do with the object detection to make my project a little bit creative? some ideas about what else can we do with object detection
I think for safety applications a great value add is to generate time stamped reports of say where people weren't wearing a hard hat. This saves time and cost from safety inspectors manually having to do the work!
Can you show how to stop training and resume training from the last available checkpoint, assuming I had trained for about 2400 steps and stopped it. Can I later restart training from e.g. ckpt-4 if I have it available
You can! You need to do a few things to do that though, I was going to cover it in the latest vid but it's already 5.5 hours. I'll cover it next week!
hy nich, please help me find the error , the command promt raises an error while copying the folder of setup.py as 'cp' is not recogized as internal or external command
can you please help me with this