Closed iamthealphamale closed 5 years ago
Hi, check whether you set the right path (DATASET_FOLDER) in generate_dataset.py. Did you use a new dataset or Oxford-IIIT? If you use a new dataset, you will have to change generate_dataset.py. The script train_model.py expects the following columns in the csv file: path, class_id, width, height, x0, y0, x1, y1
Yes, I pasted the path of the dataset folder and used original dataset for now. As an alternative, could you please upload train.csv and validation.csv here so I could have a look? I would really appreciate it!
Hi Lars, I've the same problem of imthealphamale. why this problem? thanks a lot. Best regards.
Maybe my installation instructions were not clear enough.
The file train.csv will now contain lines like this: /home/lars/Downloads/images/Abyssinian_1.jpg,1,600,400,173,72,265,158 /home/lars/Downloads/images/Abyssinian_10.jpg,1,375,500,72,105,288,291 ...
I hope now it works for you guys
oh, yes..that's great! Now, it's work! Thank you so much, lars! last one thing, how I can use my gpu for training?How can I set it?
Best regards
No problem, you can enter in the terminal python3 -c "from keras import backend as K; print(K.tensorflow_backend._get_available_gpus())" to check whether Keras uses your GPU. Otherwise you have to configure it. Normally, you don't have to set /device:GPU:0 manually.
use this script to change xml files to single .csv files:
import os import glob import pandas as pd import xml.etree.ElementTree as ET
xml_list = [] for xml_file in glob.glob('C:/Users/-----/*.xml'): #enter the path of the xml folder print("hi") tree = ET.parse(xml_file) root = tree.getroot() for member in root.findall('object'): print("hi") value = (root.find('filename').text, int(root.find('size')[0].text), int(root.find('size')[1].text), member[0].text, int(member[4][0].text), int(member[4][1].text), int(member[4][2].text), int(member[4][3].text) ) xml_list.append(value)
column_name = ['filename', 'width', 'height', 'class', 'xmin', 'ymin', 'xmax', 'ymax'] xml_df = pd.DataFrame(xml_list, columns=column_name) xml_df.to_csv('train_test.csv', index=None) print('Successfully converted xml to csv.')
I get also an empty train.csv. Is this because the folder 'annotations' is not in the right directory? See image of my directories.
Okay it works! I had to move the annotations folder into the images folder. I used the commando 5. mv annotations/xmls/* images/ as in the instructions, but now it works!
Hello Lars, I would consider myself as a beginner in CNNs and would be grateful if you could assist with the problem I have. I have downloaded dataset and put .jpg and .xml files in the dataset folder. I have decided to put 4 instances for now to test the localization but it didn't work. train.csv and validation.csv files that are generated at the beginning when running generate_dataset.py are empty. Do you have any suggestions on why it won't work for me?
Kind regards, Arseniy