Instance Segmentation Using Mask R-CNN on Custom Dataset
Vložit
- čas přidán 18. 02. 2023
- Implementation of Mask RCNN on Custom dataset.
Github: github.com/AarohiSingla/Mask-...
Explained:
1- How to annotate the images for Mask Rcnn?
2- Train Mask RCNN model
3- Test Mask Rcnn model.
4- Calculate mean average precision mAP
5- Confusion Matrix plotted
For any queries: aarohisingla1987@gmail.com
Feature Extractor:
The first step is to take an image and extract features using the ResNet 101 architecture. These features act as an input for the next layer which is Region Proposal Network.
Region Proposal Network RPN:
We take the feature maps obtained in the previous step and apply a region proposal network .This basically predicts if an object is present in that region or not. In this step, we get those regions which the model predicts contain some object. RPN does that using a binary classifier on a lot of boxes over the image and returns object/no-object scores. Anchors with high objectness score are passed to the stage two to be classified.
This will return the candidate bounding boxes.
Region of Interest RoI:
The regions obtained from the RPN might be of different shapes, right? Hence, we apply a pooling layer and convert all the regions to the same shape.
Object detection: The second branch of the network takes the RoI feature maps and predicts class labels and bounding box offsets for each proposal. This is similar to the classification and regression branches in Faster R-CNN.
Mask prediction:
Once we have the RoIs based on the IoU values, we can add a mask for each region that contains an object.
This third branch of the network takes the RoI feature maps and generates a binary mask for each region proposal. This is achieved using a fully convolutional network that generates a pixel-wise mask for each object. where each pixel is assigned a value of 1 if it belongs to the object and 0 otherwise. This means that for each object instance in the image, Mask R-CNN produces a separate binary mask that indicates the exact location and shape of the object.
#imagesegmentation #maskrcnn #objectdetection #python #tensorflow - Věda a technologie
This code is tested on python 3.8.0, tensorflow 2.4.0 and keras 2.3.1
Mam you are awesome. You are a lifesaver for a person who is currently self learning AI ml with only CZcams and udemy and Google searching
All the best
Incredible guide, thank you very much!
Glad you enjoyed it!
Wonderful explanation ma'am.... Followed every step on my own dataset... Works just wooow.... Thanks a TON...
Glad video helped you 🙂
did u got any errors while running the code
So helpful! Thank you very much for your videos!
Glad it helped you!
I have labelled the image in lableImg with PASCALVOC extension .json, instead of VIA. Will this dataset work, will the code run without error, mostly it's not running when I tired. Can you tell if these annotations work with a few code changes, if yes what are they?
hello mam in stage 3 mask prediction where we have two images of each class, how to obtain that?
Your videos are really very much informative & useful in AI projects. Thank you ma'am
My pleasure 😊
Awesome video! They are really helpful to me, I am doing my graduation project and they had gave me a lot of understanding on the field. It would be nice to have a tutorial but with the COCO format, or at least how to goe from the COCO format to the VGG format
Glad it was helpful!
I will try to make the tutorial for requested format
most awaited video...😃
Hope you enjoyed it!
Thank you for your amazing video! I have a question, it is impossible if I can use LabeMe JSON template for this code? Thank you!!
Ma'am, I have a doubt regarding annotations, like we are having respective annotations (json files) of train images and validation images. But when we are opening json file in load_custom function, there we are hardcoding the train.json. Is this the way, or we need to format that line of code using the subset variable for taking valid.json as well? Please help me out here.
if subset == "train":
annotations1 = json.load(open('D:\\mask_r_cnn\\Dataset\\train\\data_json.json'))
elif subset == "val":
annotations1 = json.load(open('D:\\mask_r_cnn\\Dataset\\val\\data_json.json')
Thank for you video, you content help me a lot so please make a good video like this again.
Thank you, I will
thank you for the video, i'm kinda having difficulties to run the program atm. You said we don't need any other stuff but mrcnn folder, but my PC can't run the 'Custom.py' since the very beginning of the code. It keeps say 'No module named 'mrcnn.visualize'', and I found that's because i should've run 'setup.py'. but that somehow installs the thing compatible to TF 1.
for me, the logs folder is not created. Even if i create that and give the correct path for it. It doesn't save weights there.
Can we use labelme app or coco file for train annotation images?
How can we evaluate mAP per class on custom dataset?
Hello Aarohi, I have a question about the mold configuration. It can be seen that when processing the mold value is equal to 1024*1024.Can I redefine it?
How have to do with Jupiter notes r where have to run it?
ImportError: cannot import name 'type_spec_registry' from 'tensorflow.python.framework' (C:\Users\pavan\anaconda3\lib\site-packages\tensorflow\python\framework\__init__.py) how to resolve this?
ma'm i have a dataset with 50 images and corresponding json files whiach are not combined..! is there any option to merge the json files as one..? or can i train these with seperate json files for each images..the annotations are done by labellme software..!
Yes, it's possible to merge multiple JSON annotation files into a single file. One approach is to use a Python script to read in all the JSON files and merge them into a single file.
Here's an example Python script that reads in all the JSON files in a directory and merges them into a single file:
import os
import json
json_dir = 'path/to/json/files'
output_file = 'merged_annotations.json'
# Get a list of all JSON files in the directory
json_files = [os.path.join(json_dir, f) for f in os.listdir(json_dir) if f.endswith('.json')]
# Load the annotations from each JSON file and merge them into a single dictionary
merged_annotations = {}
for json_file in json_files:
with open(json_file, 'r') as f:
annotations = json.load(f)
for key in annotations:
if key not in merged_annotations:
merged_annotations[key] = []
merged_annotations[key].extend(annotations[key])
# Write the merged annotations to a new JSON file
with open(output_file, 'w') as f:
json.dump(merged_annotations, f)
@CodeWithAarohi , I would like to know where in the custom code the json annotation file is read and if not how can this be incorporated in the custom code. Secondly, I have noted that if the image names in the train and val folders aren't the same, the code returns an error that the *.jpg was not found. If you can kindly guide me on this. Could it be possible for one to edit the code to allocate training and validating data so that they are all in one folder? Thank you for the insightful videos.
Open custom.py file and search for " def train(model): " Inside this function we are providing the path of training and validation dataset
Hello
Hi, please if you see this, please respond 🙏🏽
This code is not working if you are annotating with the current version of vgg image annotator
Hi Aarohi,
I have trained MaskRNN model with my custom dataset. Could you tell me about how to measure large image where few objects span to another patch. In that case, objects metrics are not accurate.
When measuring the performance of an object detection model like Mask R-CNN on large images where objects span multiple patches, it's important to consider the evaluation method and metrics used.
One approach is to split the large image into smaller patches and run the object detection model on each patch individually. Then, you can combine the results from all patches to obtain the final detection results for the entire image. However, as you mentioned, this approach can result in inaccurate object metrics when objects span multiple patches.
Another approach is to use an object detection algorithm that supports large image processing, such as the sliding window approach. This involves dividing the large image into overlapping patches and running the object detection model on each patch. The resulting object detections are then merged and refined to produce the final detection results for the entire image.
Hello Ma, do I need to use Tensorflow 2.4.0 specifically as listed in the requirements gotten from the GitHub link, for the code to run fine? Because I realized some of the requirements listed are not compatible with that version of Tensorflow. Or can I just use latest version of everything, will it work fine?
Latest versions will give you errors for this code.
@@CodeWithAarohi Can you do another video with the newest versions of everything because I have a lot of errors and I don't how to solve them. I am currently using tensorflow 2.16.1 and keras 3.1.1
Hi Ma'am,
Thanks for the video, your explanation is way awesome. But I wanna ask about the dataset. I have datasets that already annotated from my roboflow account, is there any way convert the dataset to this Mask R CNN JSON format?
You can write custom script to convert your dataset to the required format.
Anyone knows whats the best place to actually study these masked RCNN or say transformers or anything. People on youtube just posts the copied implementation of it. If anyone knows anything, you can share
in that video you have shown us inside the dataset folder there are 3 folders but you said only train and validation folder will be there . i did not understand properly
I wanted to ask, is there any problem if we use a different tool to annotate the images, for example for my project I am using LabelMe, I have followed all the steps of the project, but it doesnt give me the expected output.
If you are using different labeling tool then make sure it is creating the annotations in the same manner which I have explained in this video.
When I try to load the .h5 weights into the model I get an error NotImplementedError: Save or restore weights that is not an instance of `tf.Variable` is not supported in h5, use `save_format='tf'. Do You know how to fix?
I am getting same error have you solved it?
I can follow in the video, but the test process is not able to segment the image, is there any advice? (Test image)
It seems that we have encountered the same problem. The segmentation task can be performed on randomly appearing images in the validation data set, but there is no segmentation in the test data set. How did you solve it? Looking forward to your answer
wow thats was awesome.....😃 plz make full tutorial on step step
Glad to hear that. And you can check this video: It is a step by step tutorial : czcams.com/video/t1MrzuAUdoE/video.html
which version of Keras and tensorflow you have used maam? Im having trouble running the code in colab
tensorflow 2.4.0 and keras 2.3.1
@@CodeWithAarohi tensorflow 2.4.0 is not installing in colab as it shows the error that only version above 2.5 can be installed . Could you please help me out with this? how to install 2.4.0 in tensorflow or if you have any other alternative to run this code.
@@CodeWithAarohi Tensorflow 2.4.0 is not available now on colab. How can I use MaskR-CNN with latest tensorflow and keras version? Please help.
@@mrbot4one You can try downgrading the pip version. And then install tensorflow 2.4
@@ravirawal13 Did it work for you?
Hello professor, Thanks for the great work,
Please during the execution of the test program I have a loss rate of 1.911, but during the test_model I obtain a good detection
of the mask for the validation images, while for the test images a bad detection .(attached figures)
Please help me Profesor to solve this problem, I don't know where I should modify or what is the cause.
Thank you for your attention and help
If you are obtaining good detections on the validation set but poor detections on the test set, it could be an indication that your model is overfitting to the validation set.
@@CodeWithAarohi Thank you for your reply, but Please what I can do to remedy this problem
Need Help Please
Train your model for more epochs and also add more data for training.
Thank you, can we save the predicted annotation images as json so that we can edit the predicted json file?
Yes it's very possible
@@achukasimonallan6720 how, please?
Hi mam when I am training my model it is giving me error "string indices must be integer" in my json file. Can you plz help.
To fix this error, make sure that you are using the correct syntax to access the elements in your JSON file. In JSON, you can access elements in an object using the following syntax:
json_obj['key']
Here, 'key' is the name of the key you want to access, and json_obj is the name of the JSON object.
Make sure that you are using a string key to access the values in your JSON file, and that you are not accidentally using an integer index.
Im having trouble running the code in colab ,because it does not support tensorflow==2.4.0
Downgrade the pip version and then install tensorflow using pip.
Mam can you tell me how to use the saved weights of the last epoch to train the model again?
Thanks in advance
model_path = model.find_last()
# Load trained weights
model.load_weights(model_path, by_name=True)
@CodeWithAarohi mam this code is not working on recent version of tensorflow and keras as the source code is importing one library keras.engine which is not available in recent versions so which version of tensorflow and keras did u used
This code is tested on python 3.8.0, tensorflow 2.4.0 and keras 2.3.1
@@CodeWithAarohi mam it's not working on any version of tensorflow>=2.x
Why there are multiple videos on your channel about Mask R CNN implementation? Is this the most accurate as it is more recent? Thank you very much for your work here on YT
Difference of video quality.
Thanks for the great work , could you show me how to install the maskrcnn with tensorflow2 implementation
Create seperate environment with python 3.8 and then install requirements from the requirements.txt file from github.com/AarohiSingla/Mask-R-CNN-using-Tensorflow2
Thank you very much
I could'nt install tensorflow 2.4.0 and it is updated to 2.11.0. how can i install the older version
Downgrade the pip version and then try to install tensorflow 2.4
Ma'am what changes we have to do if in annotation we use rectangle instead of polygon in load mask function and other functions?
these are the changes:
Modify load_mask function
def load_mask(self, image_id):
"""
Generate instance masks for an image.
Returns:
masks: A bool array of shape [height, width, instance count] with one mask per instance.
class_ids: a 1D array of class IDs of the instance masks.
"""
# Load the annotations for this image
annotations = self.image_info[image_id]['annotations']
# Create an empty mask array
mask = np.zeros([self.image_info[image_id]['height'], self.image_info[image_id]['width'], len(annotations)], dtype=np.uint8)
# Create an empty class ID array
class_ids = np.zeros([len(annotations)], dtype=np.int32)
# Loop through the annotations and generate masks for each rectangle
for i, annotation in enumerate(annotations):
# Get the coordinates of the rectangle
x1, y1, w, h = annotation['bbox']
x2, y2 = x1 + w, y1 + h
# Create a mask for the rectangle
mask[y1:y2, x1:x2, i] = 1
# Set the class ID for the mask
class_ids[i] = annotation['category_id']
return mask, class_ids
Modify draw_mask() function: In the draw_mask() function in your visualize.py file, you will also need to modify the code to draw rectangular masks instead of polygon masks.
Modify display_instances() function: In the display_instances() function in your visualize.py file, you will need to modify the code to display rectangular masks instead of polygon masks.
@@CodeWithAarohi Ma'am executing above changes resulted in this kind of error WARNING:root:You are using the default load_mask(), maybe you need to define your own one.
WARNING:root:You are using the default load_mask(), maybe you need to define your own one. It is running countinously.
Thank you so much Mam🏵️. The mask r cnn series helping me alot in learning.
Mam can you please help to improve training time for mask rcnn
Use a GPU: Mask R-CNN is a computationally intensive algorithm, and training it on a CPU can be very slow. If possible, use a GPU to accelerate the training process.
Use transfer learning: Mask R-CNN is typically pre-trained on large datasets such as COCO or ImageNet. You can take advantage of this pre-training by using transfer learning. Instead of training from scratch, start with a pre-trained model and fine-tune it on your dataset. This can significantly reduce the training time.
Use a smaller batch size: A larger batch size can help utilize the full power of a GPU, but it can also cause instability during training and result in longer training times. If you are experiencing slow training, consider using a smaller batch size. This can help stabilize the training process and improve the overall training time.
Hello Aarohi, mnany thanks for the video, it was helpfull and well explained. It would be nice if the code is updated to provide earlystop and only save the best model.
Noted. Thanks
Where can I get the dataset that you used? Thank you in advance.
Roboflow universe
ModuleNotFoundError: No module named 'mrcnn.visualize' I'M GETTING THIS ERROR PLS HELP!
Check if you have visualize.py file inside mrcnn folder. Also check if you have imported it correctly. If you don't have this file then you can get it from here: github.com/matterport/Mask_RCNN/tree/master/mrcnn
Is this better than yolov8 in terms of accuracy and speed
Mask R-CNN is a region-based model that uses a two-stage approach, where proposals for object locations are generated first and then the objects are classified and segmented. Mask R-CNN achieves high accuracy in object detection and instance segmentation, but it is relatively slow compared to other models due to its two-stage process.
On the other hand, YOLOv8 is an anchor-free one-stage object detection model that predicts bounding boxes and class probabilities directly from the input image.
In terms of accuracy, Mask R-CNN may perform better than YOLOv8 in instance segmentation tasks, but in terms of speed, YOLOv8 is generally faster than Mask R-CNN.
@@CodeWithAarohi thanks, can you tell me how to make tflite model of yolov8 or yolov7. As their official github repo does not provide any way of doing it as it does in yolov5.
@@devfordevs Hadn't tried it yet. So will try and if I succeed then I will make a video.
how can we test on random images of our choice please tell Ma’am.
Please check this github.com/AarohiSingla/Mask-R-CNN-using-Tensorflow2/blob/main/test_model.ipynb Cell no 12
@CodeWithAarohi : trying to run this code in virtual environment . while running got the below error in most of the files. Please help me out if you know the solution already:
File "X:\project\Mrcnn\Mask-R-CNN-using-Tensorflow2-main\myenv\lib\site-packages\matplotlib\transforms.py", line 49, in
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
The error you're encountering indicates a problem with importing the _path module in Matplotlib, and it seems related to issues with DLL (Dynamic Link Library) loading. Try to upgrade matplotlib and see if error get resloved: pip install --upgrade matplotlib
Error is resolved for matplotlib and error is coming for kiwisolver again and I am not able to fixed it
Hi, i am trying to run your code and i am facing problem in importing one of the file(Keras.engine ) in model.py file .
Same
yeah , im getting the same , did you get the output
same .. i searched on the tf docmentation and it says that 2.x version onwards it is inclued in tf.keras.
idk how to work forward as no proper explanation is available online
How can we find the files at minute 13.03?
logs etc.
When you will run the custom.py file, after that you will get it.
can you make a version of this tutorial on google colab? thanks in advance
Very nice!!! Can you please make car parking space detection model. It will be a great help to many viewers like me. Thanks in advance...
Sure, Will do after finishing my pipelined task.
Dear,
I met an error:
line 159, in load_mask
mask[rr, cc, i] = 1
IndexError: index 512 is out of bounds for axis 1 with size 512
in custom.py
512 by 512 is my image size
please help, many thanks.
Make sure that any computations involving the image size are correct, and that the image array is being properly initialized with the correct size. Also make sure that any operations being performed on the image array are not causing its size to change in a way that would lead to an index out of bounds error.
@@CodeWithAarohi How to initialise the image size to 512 by 512 pixel? I am using png image files. My json file is corrupted, it cannot be loaded into VGG image annotator software to view. Any problem with my images?
During annotation, you must have a point whose x coordinate is 512 and the width of the image is also 512. So 512 is coming as index out of bounds. Check your annotation.
Hi Mam,
Your videos are very helpful,
Can i run Mask RcNN in Google colab,
Because i'm not able to get results at training part.
Yes, You can run. What is the error you are facing?
@@CodeWithAarohiMam, actually i'm facing problem when training my model which is Mask RCNN , segmentation is completed with COCO weights for medical images. But, Google Colab is now with version 2.12.0. But i didn't get epochs results. It is continuously running without no results. Please help me
mam, could you please make a tutorial about object detection using Mask-RCNN and flask | object detection web application
The Mask-RCNN method uses the latest version of tensorflow
Sure, Soon
@@CodeWithAarohi thank's you mam
mam firstly thank you so much your teaching mam im getting error while running my code there is compatibly issue my laptop is not advance so i do maximam code in google colab so can you please make maskrcnn video which runs on colab i dont have cuda or something i have financial limitation hope you read this msg as soon as possible and make a video thanks in advance
You can run this with cpu also. YOu can use this same code in colab. Just upload the folder (entire code related to mask rcnn) in google drive and then open colab and select gpu. And execute !python custom.py
from parallel_model import ParallelModel
ModuleNotFoundError: No module named 'parallel_model'
Mam everything is fine but i am getting this error mam in model.py file please help me with this mam🙏🙏🙏
remove this line if you dont have GPU it will work
Thank you for your amazing tutorial on mask rcnn.
If I am not wrong, you didn’t show training process or didn’t share training code? Could you share the code ?
Thank you in advance!!
Sorry for not clearing it. Please check the video from 14:37 to 20:08 .I am explaining custom.py file in this time slot. This custom.py file responsible for training the model. The changes which I have explained in this, do that for your custom dataset and then just open terminal and type "python custom.py" . This will start the training process and you will get a "logs" folder there you can see the trained models.
@@CodeWithAarohi I just realized that I missed that part you have explained in the video.
Thank you so much for your guidance. Appreciate it!!!
@@CodeWithAarohi Sorry for another request. I followed your tutorial very carefully. However whilre running custom.py, I got following error below. It would be graeat, if you can help me as it needs for me ASAP. I searched the problem on the internet but they did not help me. "My Operating system is Ubuntu 20.04":
Traceback (most recent call last):
File "/home/user/Mask RCNN/Mask-R-CNN-using-Tensorflow2/custom.py", line 239, in
model = modellib.MaskRCNN(mode="training", config=config,
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/mrcnn/model.py", line 1832, in __init__
self.keras_model = self.build(mode=mode, config=config)
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/mrcnn/model.py", line 1870, in build
gt_boxes = KL.Lambda(lambda x: norm_boxes_graph(
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 951, in __call__
return self._functional_construction_call(inputs, args, kwargs,
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1090, in _functional_construction_call
outputs = self._keras_tensor_symbolic_call(
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 822, in _keras_tensor_symbolic_call
return self._infer_output_signature(inputs, args, kwargs, input_masks)
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 868, in _infer_output_signature
outputs = nest.map_structure(
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/util/nest.py", line 659, in map_structure
structure[0], [func(*x) for x in entries],
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/util/nest.py", line 659, in
structure[0], [func(*x) for x in entries],
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/keras_tensor.py", line 606, in keras_tensor_from_tensor
out = keras_tensor_cls.from_tensor(tensor)
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/keras/engine/keras_tensor.py", line 205, in from_tensor
type_spec = type_spec_module.type_spec_from_value(tensor)
File "/home/user/anaconda3/envs/new_rcnn/lib/python3.8/site-packages/tensorflow/python/framework/type_spec.py", line 553, in type_spec_from_value
raise TypeError("Could not build a TypeSpec for %r with type %s" %
TypeError: Could not build a TypeSpec for with type KerasTensor
which version of python supports this implementation
python 3.8
@@CodeWithAarohi but the model.py file in mrcnn gives so many errors when i try to run
are 3 different json files?
Yes, One for training, 1 for testing and 1 for validation
@@CodeWithAarohi What version of cudnn and cudatoolkit do you use?
Mam i need it in colab
You can use this same code in colab. Steps to run on google colab:
1- PAste this entire folder in your google drive.
2- Open new colab notebook. Select GPU from notebook settings.
3- Install all the requirements.
4- Pate the code of custom.py in colab notebook.
5- Run the cell.
Note : make sure to change the paths
Maam i was trying your code and is getting this error
runfile('C:/Users/ashiq/.spyder-py3/autosave/custom.py', wdir='C:/Users/ashiq/.spyder-py3/autosave')
Traceback (most recent call last):
File "C:\Users\ashiq\.spyder-py3\autosave\custom.py", line 18, in
from mrcnn import model as modellib, utils
File "C:\Users\ashiq\anaconda3\lib\site-packages\mrcnn\model.py", line 255, in
class ProposalLayer(KE.Layer):
AttributeError: module 'keras.engine' has no attribute 'Layer'
Check this: stackoverflow.com/questions/67905185/module-keras-engine-has-no-attribute-layer
Hello @CodeWithAarohi I have a this error. How can i fix it? tensorflow-intel 2.16.1 requires tensorboard=2.16, but you have tensorboard 2.4.0 which is incompatible.
pip install tensorboard==2.16.0
@@CodeWithAarohi Hello again, My python version 3.8.0, tensorflow version 2.4.0 I run it pip install tensorboard == 2.16.0 and I get this error. Please help me again. ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow-intel 2.16.1 requires tensorflow-io-gcs-filesystem>=0.23.1; python_version < "3.12", which is not installed.
tensorflow 2.4.0 requires grpcio~=1.32.0, but you have grpcio 1.64.1 which is incompatible.
tensorflow-intel 2.16.1 requires absl-py>=1.0.0, but you have absl-py 0.15.0 which is incompatible.
tensorflow-intel 2.16.1 requires flatbuffers>=23.5.26, but you have flatbuffers 1.12 which is incompatible.
tensorflow-intel 2.16.1 requires h5py>=3.10.0, but you have h5py 2.10.0 which is incompatible.
tensorflow-intel 2.16.1 requires keras>=3.0.0, but you have keras 2.4.0 which is incompatible.
tensorflow-intel 2.16.1 requires numpy=1.23.5; python_version
I try to use GPU, but I found error said
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
NotFoundError: 2 root error(s) found.
(0) Not found: No algorithm worked!
[[{{node conv1_1/Conv2D}}]]
(1) Not found: No algorithm worked!
[[{{node conv1_1/Conv2D}}]]
[[mrcnn_bbox_1/Reshape/_5649]]
0 successful operations.
0 derived errors ignored.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
You have any idea for solve this problem?
The NotFoundError error you are seeing indicates that TensorFlow was not able to find a suitable algorithm for the Conv2D operation. This can happen if your GPU does not have enough memory to run the operation, or if there is a compatibility issue between TensorFlow and your GPU driver.
Check that your GPU is properly set up and recognized by TensorFlow. You can check this by running tf.config.list_physical_devices('GPU') in a Python shell. If the output is an empty list, then TensorFlow is not able to see your GPU. You may need to install the correct GPU driver or update your version of TensorFlow.
Hi mam I am from Kolkata. However you explanation is outstanding. When I run the model with tensor flow= 2.13.0, the error is
TypeError: Could not build a TypeSpec for KerasTensor(type_spec=TensorSpec(shape=(None, None, 4), dtype=tf.float32, name=None), name='tf.math.truediv_1/truediv:0', description="created by layer 'tf.math.truediv_1'") of unsupported type .
@@geospatial90 hello, I have same error. Did you solve? @geospatial90