-
Notifications
You must be signed in to change notification settings - Fork 981
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
TypeError: None has type NoneType, but expected one of: int, long #2
Comments
Changing the string in https://github.com/datitran/raccoon-dataset/blob/master/generate_tfrecord.py#L25 to the label I'm using ( |
@jtara1 what do you mean by iron ore? |
Whatever your label is, it should match what's located in https://github.com/datitran/raccoon_dataset/blob/master/training/object-detection.pbtxt (raw text):
my previous comment points to the wrong line number; at that time I needed to replace the string 'raccoon' in the func below of the same file with 'iron ore' b/c that was my label
It's been a while since I touched this stuff, mb if I misstated something. |
Can some one help me on this. Even i changed return value to 0 but i still get the same error |
@shauviks can you post your error trace? or did you solve it? |
My Stack Trace before making the change TO-DO replace this with label mapdef class_text_to_int(row_label): This should return an integer in the else case,since line number 87 "'image/object/class/label': dataset_util.int64_list_feature(classes)," expects it to be an integer, returning an integer like 0 worked for me. |
This happens because labels in your xml are wrong in someplaces, check your csv and change those mistakes. Like instead of racoon label , you have labelled it as car. |
My object-detection.pbtxt |
python generate_tfrecord.py --label=person --csv_input=../../annotations/train_labels.csv --output_path=../../annotations/train_labels.record --img_path=../../images/train This is my run script. I just change '--label' to match with a class that you assigned in label_map.txt |
This usually happens when "label name" specified to create the tf record mismatches with the "label name" in the annotation files. |
The solution is a simple one. You just need to change the else statement so it returns 0 instead of "None".
You can find Most forums talk about return equal None. It should be zero. Ref: here I hope it works for you! |
It is working great. |
It still doesn't work! |
@yashmukaty , it worked for me by simply adding 0 instead of None. thanks |
You need this piece
You can find
make as above code which needs to be replaced with
|
|
This function only makes sense if you want to filter your label in csv with many labels but the code isn't checking for None so it doesn't have purpose. Below is what I did and it works for all labels I have in my csv: TO-DO replace this with label mapdef class_text_to_int(row_label): |
Thanks for the help :) |
Just change the label name whatever you labeling them during crop the image by labelImg tool.
Instead of 'raccon' put label name for ex:- 'car'. NOTE:- for windows just change the forward-slash like:- |
I have 23 images I'm testing this out with. I labeled my images with the bounding boxes using labelimg. I cloned this repo and updated the contents of the images, annotations, data, and training folders to hold the data I'm using. I ran the xml_to_csv.py script.
I ran the generate_tfrecord.py script and got this error.
The text was updated successfully, but these errors were encountered: