Return self._conv_forward(input, self.weight, self.bias)įile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\conv.py", line 442, in _conv_forward Return self._predict_once(x, profile, visualize)įile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\nn\tasks.py", line 82, in _predict_onceįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\nn\modules\conv.py", line 38, in forwardįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\conv.py", line 446, in forward Return self.criterion(self.predict(batch) if preds is None else preds, batch)įile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\nn\tasks.py", line 62, in predict Self.loss, self.loss_items = self.model(batch)įile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_implįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\nn\tasks.py", line 44, in forwardįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\nn\tasks.py", line 213, in loss Getattr(model, mode)(**overrides) # default args from modelįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\yolo\engine\model.py", line 371, in trainįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\yolo\engine\trainer.py", line 192, in trainįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\yolo\engine\trainer.py", line 330, in _do_train Do keep sharing your progress with us!Įpoch GPU_mem box_loss cls_loss dfl_loss Instances Sizeįile "C:\Users\Victor\AppData\Local\Programs\Python\Python39\lib\site-packages\ultralytics\yolo\cfg\_init_.py", line 398, in entrypoint Great job in debugging and modifying the code! Your insights might be helpful to others who are looking to train YOLO models on grayscale images. Just be careful as to avoid inadvertently modifying key components in the code, as it might disrupt the usual training routine that's been optimized for color images. When using regular RGB images, this needs to be modified back. Remember that, these modifications are for grayscale model training only. Then, it converts the numpy array into a Pytorch tensor. If it is, it adds an extra dimension so that it forms a single channel image. The modification checks if the image is grayscale (by verifying if it only has two dimensions). This effectively disables any augmentation routines that might only be suitable for color images.įinally, you edited augment.py and modified the _format_img function. In base.py, you modified the load_image function to use the cv2.IMREAD_GRAYSCALE flag, which instructs OpenCV to load the image as grayscale. Those changes you mentioned will help load and process grayscale images, by forcing opencv to read the images in grayscale mode and disabling any augmentation that might attempt to use color information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |