Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in training YOLOv3 #28

Closed
Midhilesh29 opened this issue Apr 30, 2020 · 11 comments
Closed

Problem in training YOLOv3 #28

Midhilesh29 opened this issue Apr 30, 2020 · 11 comments
Labels
help wanted Extra attention is needed

Comments

@Midhilesh29
Copy link

Training problem
I was training yolov3 with batchsize=2. I got the following error:

RuntimeError                              Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in _try_get_data(self, timeout)
    760         try:
--> 761             data = self._data_queue.get(timeout=timeout)
    762             return (True, data)

11 frames
/usr/lib/python3.6/queue.py in get(self, block, timeout)
    172                         raise Empty
--> 173                     self.not_empty.wait(remaining)
    174             item = self._get()

/usr/lib/python3.6/threading.py in wait(self, timeout)
    298                 if timeout > 0:
--> 299                     gotit = waiter.acquire(True, timeout)
    300                 else:

/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/signal_handling.py in handler(signum, frame)
     65         # Python can still get and update the process status successfully.
---> 66         _error_if_any_worker_fails()
     67         if previous_handler is not None:

RuntimeError: DataLoader worker (pid 2546) is killed by signal: Bus error. It is possible that dataloader's workers are out of shared memory. Please try to raise your shared memory limit.

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-37-5dcbfe173d75> in <module>()
----> 1 gtf.Train(num_epochs=1);

/content/Monk_Object_Detection/7_yolov3/lib/train_detector.py in Train(self, num_epochs)
    386                     # Train mutation

Inference problem
I tired to train yolov3-tiny instead for 1 epoch. With this trained yolov3-tiny, I tried to infer the model

img_path = "/content/drive/My Drive/Monkai/PRImA Layout Analysis Dataset/images/Train/00001317.tif";
gtf.Predict(img_path, conf_thres=0.3, iou_thres=0.5);

I got the following error

AssertionError                            Traceback (most recent call last)
<ipython-input-20-c510a274f973> in <module>()
      1 img_path = "/content/drive/My Drive/Monkai/PRImA Layout Analysis Dataset/images/Train/00001317.tif";
----> 2 gtf.Predict(img_path, conf_thres=0.3, iou_thres=0.5);
      3 #Image(filename='/content/drive/My Drive/Career/output.jpg')

1 frames
/content/Monk_Object_Detection/7_yolov3/lib/infer_detector.py in Predict(self, img_path, conf_thres, iou_thres)
    100         self.system_dict["local"]["dataset"] = LoadImages(source, 
    101                                                             img_size=self.system_dict["params"]["img_size"],
--> 102                                                             half=self.system_dict["params"]["half"]);
    103 
    104         # Get names and colors

/content/Monk_Object_Detection/7_yolov3/lib/utils/datasets.py in __init__(self, path, img_size, half)
     65         else:
     66             self.cap = None
---> 67         assert self.nF > 0, 'No images or videos found in ' + path
     68 
     69     def __iter__(self):

AssertionError: No images or videos found in tmp

Please help me with these problems.

@abhi-kumar
Copy link
Contributor

Please check the path to dataset if it's proper or not

@abhi-kumar
Copy link
Contributor

Let us know your code and directory structure if the error persists

@abhi-kumar abhi-kumar added the help wanted Extra attention is needed label May 1, 2020
@Shreyashwaghe
Copy link
Contributor

I am also getting the ' No images or videos found in tmp' error,

@abhi-kumar
Copy link
Contributor

Can you please share the code and folder directory details?

@Midhilesh29
Copy link
Author

Hi
The link of my code: https://colab.research.google.com/drive/14A3siVGbRn3x-AbSwAJhThEu9iURlVFK?authuser=3#scrollTo=jHxFzDF5pABG
In this notebook, I have created a markdow as "error" the cell under that markdown has the error.
Also, I have solved this problem by copying the images to monkai folder the following command tells that

!cp "/content/drive/My Drive/Monkai/input.tif" "Monk_Object_Detection/example_notebooks/sample_dataset/ship/test/"

@abhi-kumar
Copy link
Contributor

Ok. So it was more like a file not found error

@Midhilesh29
Copy link
Author

Midhilesh29 commented May 4, 2020

yes, inside the yolov3 implementation there is a line

os.system("cp"  "<the path of image or video">  /tmp)

This particular line has some problem in execution. I also checked the /tmp/ folder !ls /tmp. It returned empty list. So what I think was the copy command which is being executed in os.system is working so files weren't copying to tmp folder and error has been thrown.

@THEFASHIONGEEK
Copy link
Contributor

Try to change the .cfg file as mentioned in this link

@abhi-kumar
Copy link
Contributor

We have made the necessary changes, please check if the error is now resolved for you?

@abhi-kumar
Copy link
Contributor

Closing due to inactivity.

@gauravgund
Copy link

@abhi-kumar : I am getting an error while using pretrained yolov3 for Document Layout Analysis i.e.

AssertionError: No images or videos found in tmp

I am following this tutorial: https://pub.towardsai.net/object-detection-document-layout-analysis-using-monk-object-detection-toolkit-6c57200bde5

Also, are there any tutorials to fine tune the yolov3 models, that will be of great help! I have worked with darknet and ultralytics for yolov5. Din't see any information about fine-tuning on the Github page.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants