ZeroDivisionError while training model
wilderlands-cody opened this issue · 2 comments
Hi there,
While attempting to train using data exported post-annotation step the application seemed to hang and produce the following error.
C:\Windows\System32>echo off
Path to conda as imported from "C:\PROGRA~1\EcoAssist_files\EcoAssist\logfiles\path_to_conda_installation.txt" is: "C:\ProgramData\miniforge3"
Path to git as imported from "C:\PROGRA~1\EcoAssist_files\EcoAssist\logfiles\path_to_git_installation.txt" is: "C:\Program Files\Git"
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\ProgramData\miniforge3\envs\ecoassistcondaenv\lib\tkinter\__init__.py", line 1892, in __call__
return self.func(*args)
File "EcoAssist\EcoAssist_GUI.py", line 612, in start_training
prepare_data_for_training(data_dir, var_test_prop.get(), var_val_prop.get())
File "EcoAssist\EcoAssist_GUI.py", line 512, in prepare_data_for_training
pascal_voc_to_yolo(data_folder)
File "EcoAssist\EcoAssist_GUI.py", line 1362, in pascal_voc_to_yolo
send_to_output_window(f" {counts['background']} background images ({round(counts['background'] / counts['images'] * 100, 1)}% of total n images)")
ZeroDivisionError: division by zero
I'm only use a small sample of roughly 20 images to try familiarize myself with the training process so maybe I'm doing something wrong / not using a large enough sample.
Any assistance would be helpful!
training using: megadetector 5b model
Cheers
Which EcoAssist version are you using? This ZeroDivisionError
is fixed in the latest version.
Also, in the new version you'll have to manually verify images before you can export it as training data. That's why you won't see a data exportation feature in postprocessing. That has been moved to the annotation step, where you can select which images you'd like to verify. At the end you'll get the option to export as training data.
Let me know if you need more assistance and if this solved your question.
Cheers
... to try familiarize myself with the training process ...
One more thing, the train function in EcoAssist creates object detection models, which need quite some processing power and a lot of training data to develop. As it turns out, better results can be obtained by using a object classification model to be used in conjunction with the results of MegaDetector. The animals will then be located by MegaDetector, and further classified by your custom model.
Just so you know, the training feature in EcoAssist is thus is a bit outdated. EcoAssist v4.2 does support the deployment of a classification model to be used in conjunction with MegaDetector, but it's not yet possible to train one through the GUI.