THANK YOU OH MY GOSH, YOU RE MY HERO just thank you for all this playlist - you`re making a world a better place by helping a newcomers like me to deal with so much frustration I`ve spend HOURS trying to implement things from tutorials but only after watching your videos (at least 3 times each one XD) I`ve finally understood what going on here with all these models, apis, label and etc. geez, really I cant thank you enough (should probably buy you a coffee one day, when I`ll have more stable financial situation as a gesture to show my appreciation)
The most important rule for making online coding tutorials is to enlarge your font as much as possible, so that people can follow it from even a mobile. Your video font is so small on my large monitor also. Hope your next videos use better bigger fonts for easy following.
Hi, I am stuck at a point where while I was training a custom model my execution stopped or paused at 2024-06-19 12:33:22.948786: W tensorflow/core/framework/dataset.cc:956] Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations. Can anyone help me on how to resolve this. I'm using tensorflow==2.13.1
you won't belive how much you helped me, there are some simpler object detector trainers like Yolo's ultralytics but i was bound to use TF framework and your video helped me a lot, thanks and keep the good work up. ❤🙏
I hope you can get back to me but do you have the dependency list anywhere? I got an error something about s3 plug in while trying to run it locally like in 24:16. I messed around with the dependencies and now I’m stuck. Thanks 👍.
For the tensorboard to work, you will need to specify the directory where your training checkpoints are being saved. So `tensorboard --logdir="training"` should do the job
import tensorflow.compat.v2 as tf ModuleNotFoundError: No module named 'tensorflow.compat' Hi sir, my project had this error and I can't find solution for that
In the google colab tutorial I keep getting an error when I run the code block: %%bash cd models/research/ protoc object_detection/protos/*.proto --python_out=. cp object_detection/packages/tf2/setup.py . python -m pip install . I get this error: CalledProcessError: Command 'b'cd models/research/ protoc object_detection/protos/*.proto --python_out=. cp object_detection/packages/tf2/setup.py . python -m pip install . '' returned non-zero exit status 1. Can anyone help??
Hi, very good tutorial, except I'm getting a "AssertionError: No checkpoint specified (save_path=None); nothing is being restored." after trying to export the inference graph. Have you seen this error before?
Brilliant tutorial! I followed the first one which worked perfectly though I also added a line to install TF with GPU support. (conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0) But now, when I'm training, I get errors like: error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice 2024-12-08 16:38:51.826058: W tensorflow/core/framework/op_kernel.cc:1768] UNKNOWN: JIT compilation failed. Traceback (most recent call last): File "D:\Capstone\working\Tensorflow\models esearch\object_detection\model_main_tf2.py", line 112, in tf.compat.v1.app.run() File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 308, in run _run_main(main, args) File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 254, in _run_main sys.exit(main(argv)) File "D:\Capstone\working\Tensorflow\models esearch\object_detection\model_main_tf2.py", line 103, in main model_lib_v2.train_loop( File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 685, in train_loop losses_dict = _dist_train_step(train_input_iter) File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\eager\execute.py", line 54, in quick_execute tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.UnknownError: Graph execution error: Detected at node 'train_input_images/write_summary/mod' defined at (most recent call last): File "C:\Users acha\anaconda3\envs\tf2\lib\threading.py", line 937, in _bootstrap self._bootstrap_inner() File "C:\Users acha\anaconda3\envs\tf2\lib\threading.py", line 980, in _bootstrap_inner self.run() File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 629, in train_step_fn if record_summaries: File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 630, in train_step_fn tf.compat.v2.summary.image( File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\tensorboard\plugins\image\summary_v2.py", line 141, in image tag=tag, tensor=lazy_tensor, step=step, metadata=summary_metadata File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 599, in lambda: global_step % num_steps_per_iteration == 0): Node: 'train_input_images/write_summary/mod' Detected at node 'train_input_images/write_summary/mod' defined at (most recent call last): File "C:\Users acha\anaconda3\envs\tf2\lib\threading.py", line 937, in _bootstrap self._bootstrap_inner() File "C:\Users acha\anaconda3\envs\tf2\lib\threading.py", line 980, in _bootstrap_inner self.run() File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 629, in train_step_fn if record_summaries: File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 630, in train_step_fn tf.compat.v2.summary.image( File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\tensorboard\plugins\image\summary_v2.py", line 141, in image tag=tag, tensor=lazy_tensor, step=step, metadata=summary_metadata File "C:\Users acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 599, in lambda: global_step % num_steps_per_iteration == 0): Node: 'train_input_images/write_summary/mod' 2 root error(s) found. (0) UNKNOWN: JIT compilation failed. [[{{node train_input_images/write_summary/mod}}]] [[Identity_9/_1526]] (1) UNKNOWN: JIT compilation failed. [[{{node train_input_images/write_summary/mod}}]] 0 successful operations. 0 derived errors ignored. [Op:__inference__dist_train_step_99044] 2024-12-08 16:38:59.216225: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:390] Filling up shuffle buffer (this may take a while): 834 of 2048 2024-12-08 16:39:04.167483: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:415] Shuffle buffer filled. I remember you mentioning that you don't hava a Nvidia GPU but would you ever consider making a tutorial for using CUDA with tf? Or maybe an updated 2024 version?
i could solve this problem using in WindowsButton -> Settings ->Time and Language ->Admin Language Settings -> change system locale and then mark "Use utf-8 to worldwide language support" ok and reboot.
First of all Thank you ❤❤ for this wonderful and easy to follow tutorial on object detection , i was hoping if you could share how to test the model in colab itself and how to convert our model into a tflite file
Hello, thank you very much for this tutorial 👍, I saw on the github of the object detection API that the framework is now deprecated, since 5 months I think, do you know if it is still relevant to use it, and what to replace it by in the future ?
I got this error "ValueError: Cannot assign value to variable ' conv5_block1_1_conv/kernel:0': Shape mismatch.The variable shape (1, 1, 1024, 512), and the assigned value shape (1, 1, 1088, 256) are incompatible." when trying to train using faster RCNN. in the train and test image. the image size is 295x440. is it because my images are too small?
Hi, I have a question. Why does TensorFlow Object Detection (TFOD) use steps? Also, what is the difference between steps and epochs? Why do steps tend to be in the tens of thousands, while epochs usually only reach the hundreds?
I training a ssd_mobilnet_V2 but after 300 steps, I have not memory and I tried to used the model before stop the training bur It doesn´t detect the piece of the dataset. Could you help me, please? How many steps do you train your model? and what model do you recommend me?
Has anyone had a similar problem? 'self._read_buf = _pywrap_file_io.BufferedInputStream( UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 100: invalid start byte'
Hi guys, i could solve this problem using in WindowsButton -> Settings ->Time and Language ->Admin Language Settings -> change system locale and then mark "Use utf-8 to worldwide language support" ok and reboot.
Went through the detection process, trying to get through this. Very helpful With this one, I see some *.py files in the git, but no images or examples that can be used to follow along. Is there another git somewhere? do you do any consulting?
First of all, thank you for the amazing tutorial. It helped me a lot with a project of mine and I'm still working on it. Second thing, is there a way to get the accuracy of the model with this method? Most sources online tell me to add the accuracy flag while training but I don't think that's the right way of doing it in this case. I tried loading the images in a numpy array and using the model.evaluate() function but it doesn't work well because the labeled images are all different sizes and python doesn't like that (i could try resizing but wouldn't that lose me data?). How should I go about it?
If tfrecords are generated with script in his repo , problem with assertion ( bounding box exceed 1.1 ) can occure when running evaulvation on models , as in genetrate_tfrecord.py you taking image size with : image = Image.open(encoded_jpg_io) width, height = image.size but reading x , y min/max from .csv , that causes that width/height are different than in xmls , thereofe its better to adjust for index loop like this : for index, row in group.object.iterrows(): width = row['width'] height = row['height'] xmins.append(row['xmin'] / width) xmaxs.append(row['xmax'] / width) ymins.append(row['ymin'] / height) ymaxs.append(row['ymax'] / height)
Your tutorial is amazing straightforward and saved me a lot of headache looking through other tutorials. I have a question, would you happen to know how to export to tflite format for object detection for RaspPi. Been trying to figure this out but to no avail.
thank you so much , but i have some problem when i test the model the image dose not show container border on the detect object and i really don't know the issues can anyone help me please
i running my model on local PC and stuck in with these message for a long time, what should i do? tensorflow/core/framework/dataset.cc:769] Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.
Hi.It was wonderfuil tutorial. Every thing went well when I tested my trained model with ( detect_from_image.py) .When I wanted to load the model with (detect_from_webcam.py) it gave me this error: return ops.EagerTensor(value, ctx.device_name, dtype) ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type NoneType).Please help me
Idk if you can help me but I am getting the following error when I run the training script: Tensorflow: AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'
I was also getting the same error. It related to Tensorflow version 2.14 (latest one). I resolved it with the solution provided here. Basically by downgrading the version to 2.13. stackoverflow.com/questions/77247945/tensorflow-attributeerror-module-tensorflow-python-ops-control-flow-ops-has
I'm still following on 10:59 time stamp and having issue while i did a command with "python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record" because after i executed this command the output that appears is like "2024-05-16 14:29:12.665173: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2024-05-16 14:29:12.666202: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2024-05-16 14:29:20.137487: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found 2024-05-16 14:29:20.138579: W tensorflow/stream_executor/cuda/cuda_driver.cc:263] failed call to cuInit: UNKNOWN ERROR (303) 2024-05-16 14:29:20.149179: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: LAPTOP-SRJO8REI 2024-05-16 14:29:20.150119: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: LAPTOP-SRJO8REI Traceback (most recent call last): File "C:\TF2\models-master esearch\object_detection\generate_tfrecord.py", line 106, in tf.app.run() File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 308, in run _run_main(main, args) File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 254, in _run_main sys.exit(main(argv)) File "C:\TF2\models-master esearch\object_detection\generate_tfrecord.py", line 97, in main tf_example = create_tf_example(group, path) File "C:\TF2\models-master esearch\object_detection\generate_tfrecord.py", line 86, in create_tf_example 'image/object/class/label': dataset_util.int64_list_feature(classes), File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\object_detection\utils\dataset_util.py", line 30, in int64_list_feature return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) TypeError: None has type NoneType, but expected one of: int, long" does anyone can help me to fix this issue?
Can you use this to have multiple (really) different objects? Like instead of similar things like legos could you do a mask, banana, and soda cans? (as an example). Either way, very helpful!
Appreciate your effort Sir. Help me a lot for my project. However, may I know how can I extract the Accuracy/Precision or anymore informative data while the training is done?
Hi ben, how do you get the train data set on the local pc ? For example , after i train the custom dataset on my local pc . How do i get the train file ?
Thank you for this tutorial. However, during training I encountered the following error: TypeError: Since we are restoring a v2 style checkpoint restore_map was expected to return a (str -> Model) mapping, but we received a (str -> CheckpointV1) mapping instead. I am training it it Local
Does the colab notebook still work? As I've encountered in my other projects, the object_detection API won't install. Also, Tensorflow==2.6.0 is not available.
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: =ssd_efficientdet_d0_512x512_coco17_tpu-8.config : The system cannot find the file specified. ; No such file or directory
Fixed it. python model_main_tf2(.)py --pipeline_config_path=ssd_efficientdet_d0_512x512_coco17_tpu-8.config --model_dir==training --alsologtostderr. There should only be one equal sign before "ssd_efficientdet_d0_512x512_coco17_tpu-8.config", the code in the readme is wrong. I had to remove the "." betweeb tf2 and py because youtube kept deleting my reply.
This is also a problem for the code that generates the training folder, it also has an extra equal symbol before training resulting in the training folder being named "=training". This causes another error later on when you are exporting your inference graph. I feel pretty smart right now but I know I'm not.
Hi, need some help model_dir = 'training/' Is the model which you unzipped saved in this directory 'training'. If not what is supposed to be in 'training'.
The training directory that exists on my local pc was created from training on local pc, if you are downloading your model from google colab you shouldn’t have to worry about it
Yes! In the run_inference_for_single_image function, there is a variable called num_detections which holds a count of all the things detected. It’s also a good video idea so I’ll make one about doing this soon!
can you explain how to convert saved model to tensorflowjs format, because currently i use your video example and use .pb format, but i want to convert it to .h5 format for web detection
is this necessary? I checked my model with (detect_from_images.py) it worked well .but when I checked with (detecgt_from_webcam.py) it gave me this error: return ops.EagerTensor(value, ctx.device_name, dtype) ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type NoneType).can you help? did you find any solution ?
I am getting this error. I am using all images with jpeg format please help Unknown image file format. One of JPEG, PNG, GIF, BMP required. [[{{node case/cond/cond_jpeg/decode_image/DecodeImage}}]] [[MultiDeviceIteratorGetNextFromShard]] [[RemoteCall]] [[while/body/_1/IteratorGetNext]] [Op:__inference__dist_train_step_55134]
@@TRENTINATERx2000 tensorflow addons is a package that establishes a well api background.. ie it provides a well distribution for packages like losses, optimizers, layers etc. . When you try to execute the code explained in here on your GPU… it throws out an error saying the tensorflow addons are not more present hence couldn’t be processed… when looked at documentation, tfa has gone to minimal contributions until may 2024… and would discontinue henceforth… which makes the current usage of tensorflow 2.8 unusable…. Hence you have to upgrade you tensorflow to newer versions.. which is another hectic work
I'm not sure if anyone of you face this problem like I do: AttributeError: module 'tensorflow' has no attribute 'contrib'. I follow exactly along the videos but just don't understand why is this thing happening. I searched online and they said this thing has deprecated starting TF 2.0 Alpha. I have rewatched this video several times, I pretty sure that I follow exactly as in the videos. Can anyone please help me out? Thanks!
Great Tuto but have a little problem to solve via colab the model_maim_tf2.py run run properly ===> this is the error AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case' . Someone has an idea ? Thanks and a good day
Hello! I got the same error. # Fix for error: Attributeerror: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case' import shutil import re original_path = '/usr/local/lib/python3.10/dist-packages/tf_slim/data/tfexample_decoder.py' with open(original_path, 'r') as file: content = file.read() content = re.sub(r'import abc', 'import tensorflow as tf
import abc', content) content = re.sub(r'control_flow_ops.case', 'tf.case', content) content = re.sub(r'control_flow_ops.cond', 'tf.compat.v1.cond', content) with open(original_path, 'w') as file: file.write(content) print(f"File {original_path} fixed.") This piece of code helped me solve the error!
can you help me sir? tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: =ssd_efficientdet_d0_512x512_coco17_tpu-8.config : The system cannot find the file specified. ; No such file or directory what should i do?
@@LazyTech825 issue solved sir, i got a typo on command i have another question sir W0225 08:04:49.470887 140626416908096 deprecation.py:350] From /usr/local/lib/python3.8/dist-packages/tensorflow/python/util/dispatch.py:1176: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use `tf.cast` instead. why is my model stuck in there when i'm trying to run a training command, it is normal or not? thanks for your reponse sir
File "C:\ProgramData\miniconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 76, in _preread_check self._read_buf = _pywrap_file_io.BufferedInputStream( UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 94: invalid continuation byte (tf2) PS C:\Users\Octava\PycharmProjects\tenserflow\models esearch\object_detection> I still haven’t found a solution to this problem, although I followed your guides step by step from installing tensorflow and conda to training my own model.
THANK YOU OH MY GOSH, YOU RE MY HERO
just thank you for all this playlist - you`re making a world a better place by helping a newcomers like me to deal with so much frustration
I`ve spend HOURS trying to implement things from tutorials but only after watching your videos (at least 3 times each one XD) I`ve finally understood what going on here with all these models, apis, label and etc.
geez, really I cant thank you enough (should probably buy you a coffee one day, when I`ll have more stable financial situation as a gesture to show my appreciation)
I’m glad it helped!!
THANK YOU! this helped me so much, even chatgpt got crumbled up because he doesn't know the newer versions. you're a life saver my guy
Followed many tutorials but your videos were simple and organized, your videos helped me complete my college project. Thanks a lot!!!
Glad I could help!
where can i find the colab notebook ?
This is the best and clean tutorial I have seen so far. Thank you.
Thank you! That means a lot!!
The most important rule for making online coding tutorials is to enlarge your font as much as possible, so that people can follow it from even a mobile. Your video font is so small on my large monitor also. Hope your next videos use better bigger fonts for easy following.
How about zoom and use a little brain cells
@@fragment7damn bro😂. True that!
Awesome! Thank you so much for making this!
Glad you liked it!
Hi, I am stuck at a point where while I was training a custom model my execution stopped or paused at
2024-06-19 12:33:22.948786: W tensorflow/core/framework/dataset.cc:956] Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.
Can anyone help me on how to resolve this. I'm using tensorflow==2.13.1
This was a great video. Thank you for uploading.
Glad you enjoyed it!
you won't belive how much you helped me, there are some simpler object detector trainers like Yolo's ultralytics but i was bound to use TF framework and your video helped me a lot, thanks and keep the good work up. ❤🙏
I hope you can get back to me but do you have the dependency list anywhere? I got an error something about s3 plug in while trying to run it locally like in 24:16. I messed around with the dependencies and now I’m stuck. Thanks 👍.
Thank you for very helpful video!
For the tensorboard to work, you will need to specify the directory where your training checkpoints are being saved. So `tensorboard --logdir="training"` should do the job
Works! Thanks
thanks man
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named 'tensorflow.compat'
Hi sir, my project had this error and I can't find solution for that
Try this line of code instead:
import tensorflow._api.v2.compat.v2 as tf
It worked for me (VSCode)
Really nice tutorial! Only thing to improve for he next ones is the font size, makes it difficult to read. Keep it up!
Dude thank you so much for this.
code is obsolete, with TF 2.16 the colab does not work
what should we do?
@@Moein_rmzyou have to find another optimal solution like using media pipe or yolo etc… until the object detection api becomes a stable version
Love this tutorial❤
Glad you liked it!!
This was super helpful!
I'm so glad!
In the google colab tutorial I keep getting an error when I run the code block:
%%bash
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
I get this error:
CalledProcessError: Command 'b'cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
'' returned non-zero exit status 1.
Can anyone help??
From the training process, can we see the weight and bias results for each layer that will be used for test data?
Thank you so much for this!
Glad it was helpful!
Hi, very good tutorial, except I'm getting a "AssertionError: No checkpoint specified (save_path=None); nothing is being restored." after trying to export the inference graph. Have you seen this error before?
Yep im facing the same issue
Are you seeing this error on colab or local?
@@LazyTech825 local, I fixed by changing the command, my training folder had an “=“ in front of “training” so that caused the problem
Glad you figured it out!
Brilliant tutorial! I followed the first one which worked perfectly though I also added a line to install TF with GPU support. (conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0)
But now, when I'm training, I get errors like:
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
2024-12-08 16:38:51.826058: W tensorflow/core/framework/op_kernel.cc:1768] UNKNOWN: JIT compilation failed.
Traceback (most recent call last):
File "D:\Capstone\working\Tensorflow\models
esearch\object_detection\model_main_tf2.py", line 112, in
tf.compat.v1.app.run()
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 308, in run
_run_main(main, args)
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 254, in _run_main
sys.exit(main(argv))
File "D:\Capstone\working\Tensorflow\models
esearch\object_detection\model_main_tf2.py", line 103, in main
model_lib_v2.train_loop(
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 685, in train_loop
losses_dict = _dist_train_step(train_input_iter)
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\eager\execute.py", line 54, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.UnknownError: Graph execution error:
Detected at node 'train_input_images/write_summary/mod' defined at (most recent call last):
File "C:\Users
acha\anaconda3\envs\tf2\lib\threading.py", line 937, in _bootstrap
self._bootstrap_inner()
File "C:\Users
acha\anaconda3\envs\tf2\lib\threading.py", line 980, in _bootstrap_inner
self.run()
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 629, in train_step_fn
if record_summaries:
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 630, in train_step_fn
tf.compat.v2.summary.image(
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\tensorboard\plugins\image\summary_v2.py", line 141, in image
tag=tag, tensor=lazy_tensor, step=step, metadata=summary_metadata
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 599, in
lambda: global_step % num_steps_per_iteration == 0):
Node: 'train_input_images/write_summary/mod'
Detected at node 'train_input_images/write_summary/mod' defined at (most recent call last):
File "C:\Users
acha\anaconda3\envs\tf2\lib\threading.py", line 937, in _bootstrap
self._bootstrap_inner()
File "C:\Users
acha\anaconda3\envs\tf2\lib\threading.py", line 980, in _bootstrap_inner
self.run()
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 629, in train_step_fn
if record_summaries:
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 630, in train_step_fn
tf.compat.v2.summary.image(
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\tensorboard\plugins\image\summary_v2.py", line 141, in image
tag=tag, tensor=lazy_tensor, step=step, metadata=summary_metadata
File "C:\Users
acha\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py", line 599, in
lambda: global_step % num_steps_per_iteration == 0):
Node: 'train_input_images/write_summary/mod'
2 root error(s) found.
(0) UNKNOWN: JIT compilation failed.
[[{{node train_input_images/write_summary/mod}}]]
[[Identity_9/_1526]]
(1) UNKNOWN: JIT compilation failed.
[[{{node train_input_images/write_summary/mod}}]]
0 successful operations.
0 derived errors ignored. [Op:__inference__dist_train_step_99044]
2024-12-08 16:38:59.216225: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:390] Filling up shuffle buffer (this may take a while): 834 of 2048
2024-12-08 16:39:04.167483: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:415] Shuffle buffer filled.
I remember you mentioning that you don't hava a Nvidia GPU but would you ever consider making a tutorial for using CUDA with tf? Or maybe an updated 2024 version?
Hello, I'm wondering if I can export the coordinate of the bounding box? And how to do it? Thank you very much
ca you help me?
when I see
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8c in position 94: invalid start byte
Hi! I have the same issue. Did you solve it?
In my case, I messed up the xml files. Check if xml files exist for each image
i could solve this problem using in WindowsButton -> Settings ->Time and Language ->Admin Language Settings -> change system locale and then mark "Use utf-8 to worldwide language support" ok and reboot.
First of all Thank you ❤❤ for this wonderful and easy to follow tutorial on object detection , i was hoping if you could share how to test the model in colab itself and how to convert our model into a tflite file
Thank you! If you go to the GitHub repo I have linked and go up the fork to the original repo, there are examples in there on how to test it on colab!
Hello, thank you very much for this tutorial 👍, I saw on the github of the object detection API that the framework is now deprecated, since 5 months I think, do you know if it is still relevant to use it, and what to replace it by in the future ?
absolutely, its not working as mostly depricated things are there
I got this error "ValueError: Cannot assign value to variable ' conv5_block1_1_conv/kernel:0': Shape mismatch.The variable shape (1, 1, 1024, 512), and the assigned value shape (1, 1, 1088, 256) are incompatible." when trying to train using faster RCNN. in the train and test image. the image size is 295x440. is it because my images are too small?
I got this error in colab:
AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'
same here. Did you solve this?
@@piotrn4717 have u solved this?
did you solve it already by any chance?
Hi, I have a question. Why does TensorFlow Object Detection (TFOD) use steps? Also, what is the difference between steps and epochs? Why do steps tend to be in the tens of thousands, while epochs usually only reach the hundreds?
I training a ssd_mobilnet_V2 but after 300 steps, I have not memory and I tried to used the model before stop the training bur It doesn´t detect the piece of the dataset. Could you help me, please? How many steps do you train your model? and what model do you recommend me?
Is there any easy way of calculating the accuracy of your own model created with this tutorial?
Has anyone had a similar problem? 'self._read_buf = _pywrap_file_io.BufferedInputStream(
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 100: invalid start byte'
Hi, I'm facing the same error. Did you solve it?
Yes exactly, If you solved it pls help 😢
Hi guys, i could solve this problem using in WindowsButton -> Settings ->Time and Language ->Admin Language Settings -> change system locale and then mark "Use utf-8 to worldwide language support" ok and reboot.
Went through the detection process, trying to get through this.
Very helpful
With this one, I see some *.py files in the git, but no images or examples that can be used to follow along.
Is there another git somewhere?
do you do any consulting?
Did you use keras?
First of all, thank you for the amazing tutorial. It helped me a lot with a project of mine and I'm still working on it. Second thing, is there a way to get the accuracy of the model with this method? Most sources online tell me to add the accuracy flag while training but I don't think that's the right way of doing it in this case. I tried loading the images in a numpy array and using the model.evaluate() function but it doesn't work well because the labeled images are all different sizes and python doesn't like that (i could try resizing but wouldn't that lose me data?). How should I go about it?
If tfrecords are generated with script in his repo , problem with assertion ( bounding box exceed 1.1 ) can occure when running evaulvation on models , as in genetrate_tfrecord.py you taking image size with :
image = Image.open(encoded_jpg_io)
width, height = image.size
but reading x , y min/max from .csv , that causes that width/height are different than in xmls , thereofe its better to adjust for index loop like this :
for index, row in group.object.iterrows():
width = row['width']
height = row['height']
xmins.append(row['xmin'] / width)
xmaxs.append(row['xmax'] / width)
ymins.append(row['ymin'] / height)
ymaxs.append(row['ymax'] / height)
print(xmins,xmaxs,ymins,ymaxs)
classes_text.append(row['class'].encode('utf8'))
classes.append(class_text_to_int(row['class']))
Your tutorial is amazing straightforward and saved me a lot of headache looking through other tutorials. I have a question, would you happen to know how to export to tflite format for object detection for RaspPi. Been trying to figure this out but to no avail.
I’ll hopefully be making a video on how to do that soon! If you haven’t seen it already I do have a video on how to setup tflite on raspberry pi
@@LazyTech825 I've watched it and it was really informative. Thanks!
thank you so much , but i have some problem when i test the model the image dose not show container border on the detect object and i really don't know the issues can anyone help me please
I don't know for some issue the model isn't training on gpu on google colab . I am using tensorflow version 2.9.0
i running my model on local PC and stuck in with these message for a long time, what should i do?
tensorflow/core/framework/dataset.cc:769] Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.
any solution ?
I trained my model properly, but it isnt detecting anything in my images. I'n willing to share my code, does anyone underfstand whats happening?
Confidence level might be the problem
Hi.It was wonderfuil tutorial. Every thing went well when I tested my trained model with ( detect_from_image.py) .When I wanted to load the model with (detect_from_webcam.py) it gave me this error: return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type NoneType).Please help me
you are showing about the config files but we dont have access to those.. where can i get those config files
hi can i know how you evaluate the trained model you create, like what code to use to evaluate using our val data
Thanks a lot for your great tutorials. I just wonder why it does not used my GPU when it train the model instead it just used the CPU?!
I'm too having this issue
to use the GPU, you have to configure it by installing CUDA, cuDNN of the compatible version. You can find documentation online for that
Idk if you can help me but I am getting the following error when I run the training script: Tensorflow: AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'
I was also getting the same error. It related to Tensorflow version 2.14 (latest one). I resolved it with the solution provided here. Basically by downgrading the version to 2.13. stackoverflow.com/questions/77247945/tensorflow-attributeerror-module-tensorflow-python-ops-control-flow-ops-has
Same here. Can't find a solution anywhere.
On Colab i mean. Local runs fine.
I want to use faster rcnn with mobilenet. So can i change the backbone or something else using variables and checkpoints?
In which file i can perform some action while a model is detected? Let say i want to send a email to someone if a person is detected?
If I want to use dataset from roboflow universe ,which format should I choose?And what is next step I need to do?
Hope someone can help me🙏🙏🙏
I'm still following on 10:59 time stamp and having issue while i did a command with "python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record" because after i executed this command the output that appears is like
"2024-05-16 14:29:12.665173: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2024-05-16 14:29:12.666202: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2024-05-16 14:29:20.137487: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2024-05-16 14:29:20.138579: W tensorflow/stream_executor/cuda/cuda_driver.cc:263] failed call to cuInit: UNKNOWN ERROR (303)
2024-05-16 14:29:20.149179: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: LAPTOP-SRJO8REI
2024-05-16 14:29:20.150119: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: LAPTOP-SRJO8REI
Traceback (most recent call last):
File "C:\TF2\models-master
esearch\object_detection\generate_tfrecord.py", line 106, in
tf.app.run()
File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 308, in run
_run_main(main, args)
File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\absl\app.py", line 254, in _run_main
sys.exit(main(argv))
File "C:\TF2\models-master
esearch\object_detection\generate_tfrecord.py", line 97, in main
tf_example = create_tf_example(group, path)
File "C:\TF2\models-master
esearch\object_detection\generate_tfrecord.py", line 86, in create_tf_example
'image/object/class/label': dataset_util.int64_list_feature(classes),
File "C:\Users\Lenovo\anaconda3\envs\tf2\lib\site-packages\object_detection\utils\dataset_util.py", line 30, in int64_list_feature
return tf.train.Feature(int64_list=tf.train.Int64List(value=value))
TypeError: None has type NoneType, but expected one of: int, long"
does anyone can help me to fix this issue?
Look for a part in the code that says "Return None" and replace it with "Return 0" idk how Return None worked for him
Did it work
Can you use this to have multiple (really) different objects? Like instead of similar things like legos could you do a mask, banana, and soda cans? (as an example). Either way, very helpful!
Yes you can! And thanks for watching!
@@LazyTech825 Awesome, it would be cool if you made a video doing something silly with detection i think
You got it 😎
If you're using brave or some cookie blocking extension, you may get an error with tensor board, just disable it.
Appreciate your effort Sir.
Help me a lot for my project.
However, may I know how can I extract the Accuracy/Precision or anymore informative data while the training is done?
That would be Tensorboard
Hi ben, how do you get the train data set on the local pc ? For example , after i train the custom dataset on my local pc . How do i get the train file ?
Thank you for this tutorial. However, during training I encountered the following error:
TypeError: Since we are restoring a v2 style checkpoint restore_map was expected to return a (str -> Model) mapping, but we received a (str -> CheckpointV1) mapping instead.
I am training it it Local
Is that everyone able to acces the model like when we try to download the model .tar then it is saying acces denied
Does the colab notebook still work? As I've encountered in my other projects, the object_detection API won't install. Also, Tensorflow==2.6.0 is not available.
try ieth tensorflow=2.13.0 works
I wish you have tutorial on coverting it in tflite and running it in raspberry pi🙏
Can you please explain how to convert the pb model to onnx and use it with opencv. Thanks a lot.
Thank you
instead of using kaggle to save, can i use drive directly to save all the steps
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: =ssd_efficientdet_d0_512x512_coco17_tpu-8.config : The system cannot find the file specified.
; No such file or directory
same problem, have you fixed it yet?
Fixed it. python model_main_tf2(.)py --pipeline_config_path=ssd_efficientdet_d0_512x512_coco17_tpu-8.config --model_dir==training --alsologtostderr. There should only be one equal sign before "ssd_efficientdet_d0_512x512_coco17_tpu-8.config", the code in the readme is wrong. I had to remove the "." betweeb tf2 and py because youtube kept deleting my reply.
This is also a problem for the code that generates the training folder, it also has an extra equal symbol before training resulting in the training folder being named "=training". This causes another error later on when you are exporting your inference graph. I feel pretty smart right now but I know I'm not.
Hi, need some help
model_dir = 'training/'
Is the model which you unzipped saved in this directory 'training'. If not what is supposed to be in 'training'.
The training directory that exists on my local pc was created from training on local pc, if you are downloading your model from google colab you shouldn’t have to worry about it
@@LazyTech825 thanks, your tutorial was the only one that worked for me
Glad it helped!
why my regulation loss stay at 0. i follow your steps. is it because we using different model. i use inception resent v2 640x640.
where is the colab for this project ??
Awesome tutorial! Can I have the lego dataset you mentioned in Kaggle to try it out?
You can visit my Kaggle account and grab it from there!
AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case' got this error.
Use "conda activate tf2" tf2 being the name of your conda environnement that you've created.
Can u make trash detection ? Such as bottle, wrapper, plastic, can? 4 classes please
Yes! Instead of using different Lego bricks like I did, just use pictures and labels of different types of trash!
@@LazyTech825
Can you count objects in a image ? For example, how many water bottles there are in a image.
Yes! In the run_inference_for_single_image function, there is a variable called num_detections which holds a count of all the things detected. It’s also a good video idea so I’ll make one about doing this soon!
I made a video on how to do this! Check out my channel!
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type NoneType). how can i fix it?
When do you see this error? After what command?
can you explain how to convert saved model to tensorflowjs format, because currently i use your video example and use .pb format, but i want to convert it to .h5 format for web detection
is this necessary? I checked my model with (detect_from_images.py) it worked well .but when I checked with (detecgt_from_webcam.py) it gave me this error: return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type NoneType).can you help? did you find any solution ?
please answer where can i access the config fiels that you edit
Hi, I was wondering if I can use roboflow datasets instead of kaggle? if yes, how?
Nice!
Thank you! Cheers!
will the roboflow dataset work if I export it as tensorflow TFrecord and use it in the notebook?
Yes they will I have used them they work fine
I am getting this error. I am using all images with jpeg format
please help
Unknown image file format. One of JPEG, PNG, GIF, BMP required.
[[{{node case/cond/cond_jpeg/decode_image/DecodeImage}}]]
[[MultiDeviceIteratorGetNextFromShard]]
[[RemoteCall]]
[[while/body/_1/IteratorGetNext]] [Op:__inference__dist_train_step_55134]
same error
can we deploy our trained model to local host or website to detect image from uploaded image ?
I don’t know how, but I’m sure you could lol
@@LazyTech825 i hope you can make video of it, that will be helpful
The tensorflow addons have been discontinued, is there any alternative solution
Wdym by addons
@@TRENTINATERx2000 tensorflow addons is a package that establishes a well api background.. ie it provides a well distribution for packages like losses, optimizers, layers etc. . When you try to execute the code explained in here on your GPU… it throws out an error saying the tensorflow addons are not more present hence couldn’t be processed… when looked at documentation, tfa has gone to minimal contributions until may 2024… and would discontinue henceforth… which makes the current usage of tensorflow 2.8 unusable…. Hence you have to upgrade you tensorflow to newer versions.. which is another hectic work
@@istillplay271 Did you fix your issue?
Awesome ❤❤ I follow yr step success to trained model and detect object. May i know how can i convert to H5 and json format ?
if I use this tutorial but I use a mobilnet v2 ssd, will it work?
thank you sir🙏
It should
I got error at "import tensorflow.compat.v2 as tf"
please help
what is the time taken for training this model in our cpu
hello how can i conveert the pb model to tflite? make a video on that plzzz
I'm not sure if anyone of you face this problem like I do:
AttributeError: module 'tensorflow' has no attribute 'contrib'.
I follow exactly along the videos but just don't understand why is this thing happening. I searched online and they said this thing has deprecated starting TF 2.0 Alpha. I have rewatched this video several times, I pretty sure that I follow exactly as in the videos. Can anyone please help me out? Thanks!
hey, I solved this problem with !pip install tensorflow=="2.9.0"
can I use my webcam to detect the lego color?
what's the environment this was run?
Labels won't appear in my model when I run it.
Hi.... I am too facing the same problem.... So can you tell me how you solved this issue, it will be very helpful..
@@varshini.s4966 i gave up
can anyone tell me how do I get that dataset
Thanks for posting free content but the font is too small to see on a 15" laptop.
Please implement early stopping in the training please
All you have to do is stop the process while it is training!
Great Tuto but have a little problem to solve via colab the model_maim_tf2.py run run properly ===> this is the error AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case' . Someone has an idea ? Thanks and a good day
Hello! I got the same error.
# Fix for error: Attributeerror: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'
import shutil
import re
original_path = '/usr/local/lib/python3.10/dist-packages/tf_slim/data/tfexample_decoder.py'
with open(original_path, 'r') as file:
content = file.read()
content = re.sub(r'import abc', 'import tensorflow as tf
import abc', content)
content = re.sub(r'control_flow_ops.case', 'tf.case', content)
content = re.sub(r'control_flow_ops.cond', 'tf.compat.v1.cond', content)
with open(original_path, 'w') as file:
file.write(content)
print(f"File {original_path} fixed.")
This piece of code helped me solve the error!
can you help me sir?
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: =ssd_efficientdet_d0_512x512_coco17_tpu-8.config : The system cannot find the file specified.
; No such file or directory
what should i do?
What command are you running when doing this? Make sure the file path you use is pointing to the correct location
@@LazyTech825 issue solved sir, i got a typo on command
i have another question sir
W0225 08:04:49.470887 140626416908096 deprecation.py:350] From /usr/local/lib/python3.8/dist-packages/tensorflow/python/util/dispatch.py:1176: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
why is my model stuck in there when i'm trying to run a training command, it is normal or not? thanks for your reponse sir
I’m not exactly sure what you mean, can you elaborate?
Just remove the "=" sign at the beginning of the file path.
@@rastusshane726 Thank you so much for this help.
I love your tutorials!
Great suggestion!
You can open camera and detection please help me
I’m not sure what you need help with?
I mean real-time video detection object detection model not pictures 😅😅
You can use the other script in my GitHub repo to use a webcam instead of photos
where can i get the configs
File "C:\ProgramData\miniconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 76, in _preread_check
self._read_buf = _pywrap_file_io.BufferedInputStream(
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 94: invalid continuation byte
(tf2) PS C:\Users\Octava\PycharmProjects\tenserflow\models
esearch\object_detection>
I still haven’t found a solution to this problem, although I followed your guides step by step from installing tensorflow and conda to training my own model.
Hi Did you find because I have the same problem thanks
@@patis.IA-AI I’m just find another video with Yolov8
And it works with custode data ?? If yes can you guve me thé link tanks à lot
Sorry custode data 😂
Custom data
Doing God's work!
ᕦ(ò_óˇ)ᕤ
You need to raise the voice and zoom in your screen to see what you are doing. Thanks.
It's a nice tutorial can u share the colab link also
The colab file can be found in my GitHub repo under the model training folder
I personally don't prefer google colab if you're a free user. It will be extremely slow, so in short use your pc if you're a free user.
your screen is to far, can't see the code well
Getting KeyError : 'filename' ;/
Where do you see this error?
@@LazyTech825 After trying to get generate_tfrecord to work I guess