Open yang1997yi opened 7 years ago
hi,can you tell me how to make files of the annotation dir? any tools can be used?
Hi @yang1997yi
You have to make following changes also: lib/pascal_voc.py --> change the classes tools/demo.py --> change the classes
Thanks
Hi @zjz5250
You can use LabelImage tool for generating xml files for Annotation directory.
Thanks
how to change Main and Segementation floder under ImageSets @yang1997yi
how to change Main and Segementation floder under ImageSets @Akansha06
Hi @gentlebreeze1
Suppose u have 2 classes- male and female. You should have following named files in your Main folder i.e trainval.txt -->contains name of all the images train.txt and val.txt --> split the names into 70-30 ratio and add 70% to train.txt and 30% to val.txt test.txt --> pick some random image names and put it in test.txt
For each class: male.txt --> contain names of all the male images maletrain.txt, maleval.txt --> same as mentioned above(but ds data will contain only male class images name) Then same for female class.
Note: Please don't include extension inside these txt. Only names should be added. Else you ll get an error.
Happy Learning :)
Can you send me the modified code in lib/pascal_voc.py and tools/demo.py? should i modify other floders ?my email is 914672556@qq.com OR igentlebreeze1@gmail.com ,thanks! @Akansha06
but how to get 1 or -1 in male_train.txt?do you have code to make dataset? @Akansha06 thanks
AssertionError: Path does not exist: /home/c303/student/yongzhang/Faster-RCNN_TF/data/VOCdevkit2007/VOC2007/JPEGImages/.jpg what's wrong? @Akansha06
Hi @gentlebreeze1 ,
In any of your text files there is a blank line. For this reason only there is assertion error
Hi @gentlebreeze1,
I am not clear with 1 and -1 . Can you explain it?? Because I have given only names in txt's and it was working fine
The data of standard VOC2007/ImageSets/main**_train.txt is as follows: 0000005 -1 0000007 1 0000009 -1 they say that the mean of 1 is positive sample and -1 is negative sample @Akansha62
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [8] rhs shape= [84] [[Node: save/Assign = Assign[T=DT_FLOAT, _class=["loc:@bbox_pred/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](bbox_pred/biases, save/RestoreV2/_1)]] i get the problem , is it a tensorflow problem? @Akansha62
Hi @gentlebreeze1,
How many classes you are using?? You have to change it in VGGtest.py and VGGtrain.py present inside tools.
Hi @gentlebreeze1 ,
You don't have to give it 1 and -1 it will simply work
Thanks very much for your answer @Akansha62
i have 2 classes,i change classes into 3 in VGGtest.py and VGGtrain.py inside lib/networks.
is the problem related to the follows?
WARNING:tensorflow:
WARNING:tensorflow:TensorFlow's V1 checkpoint format has been deprecated.
WARNING:tensorflow:Consider switching to the more efficient V2 format:
WARNING:tensorflow: tf.train.Saver(write_version=tf.train.SaverDef.V2)
WARNING:tensorflow:now on by default.
WARNING:tensorflow:
Traceback (most recent call last):
File "./tools/test_net.py", line 99, in
Caused by op u'save/Assign_2', defined at:
File "./tools/test_net.py", line 97, in
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [3] rhs shape= [21] [[Node: save/Assign_2 = Assign[T=DT_FLOAT, _class=["loc:@cls_score/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](cls_score/biases, save/RestoreV2_2/_5)]]
it seems classes problem .i change pascal_voc.py,VGGnet_train.py and VGGnet_test.py.what else should i change? @Akansha62
Hi @gentlebreeze1 ,
Please grep any of the 21 classes . And wherever u find them change accordingly
Hi @Akansha62 , i try again,i get different problem.as follow: File "./tools/train_net.py", line 96, in max_iters=args.max_iters) File "/home/c303/student/yongzhang/Faster-RCNN_TF/tools/../lib/fast_rcnn/train.py", line 264, in train_net sw.train_model(sess, max_iters) File "/home/c303/student/yongzhang/Faster-RCNN_TF/tools/../lib/fast_rcnn/train.py", line 198, in train_model self.snapshot(sess, iter) File "/home/c303/student/yongzhang/Faster-RCNN_TF/tools/../lib/fast_rcnn/train.py", line 61, in snapshot sess.run(net.bbox_weights_assign, feed_dict={net.bbox_weights: orig_0 * np.tile(self.bbox_stds, (weights_shape[0], 1))})
ValueError: operands could not be broadcast together with shapes (4096,16) (4096,12)
Hi @gentlebreeze1 ,
I guess still somewhere your number of classes are given wrong, Please check again.
grep -irn
use dse commands and get the data, and then see somewhere you r missing something
@Akansha62 , maybe i use the trained model that cause the problem .but new problem occurs:
VOC07 metric? Yes
Reading annotation for 1/170
Traceback (most recent call last):
File "./tools/test_net.py", line 97, in
Thank you for your guidance during this time @Akansha62 @Akansha06 .I have been running successfully on my dataset.
Hi @gentlebreeze1,
Congratulations....
Happy Learning :)
What is the meaning of this document in VOC2007\ ImageSets\Layout? should i make the txt files like train.txt,val.txt and trainval.txt? @Akansha62
Hi @gentlebreeze1 ,
Layout is not necessary. It just the replica of your Main folder.
i only need to change Main floder.Train.txt in Main floder includes all classes's ***_trian.txt. @Akansha62
yes @gentlebreeze1
if i want to test my pictures use demo.py.where should i change @Akansha62
Hi @gentlebreeze1 ,
l have the error as follows:
Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
File "
/home/tf/Downloads/Faster-RCNN_TF/lib/fast_rcnn/train.py(63)snapshot() -> sess.run(net.bbox_weights_assign, feed_dict={net.bbox_weights: orig_0 * np.tile(self.bbox_stds, (weights_shape[0], 1))})
when i use the command:
grep -irn <n_classes> *
grep -irn *
new problem occurred: "bash: n_classes: No such file or directory"
l have solved the problem, by changing the VGGnet_train.py file as follows: n_classes = 2
I want to ask how you solve the problem :AttributeError: 'NoneType' object has no attribute 'text' @gentlebreeze1
Hi @gentlebreeze1 , @Akansha06 , Can you help me with the procedure of how to use the model and train it for 6 classes from 21?
hi @gentlebreeze1 , @Akansha06 , I am stuck at this stage. how do i proceed further? $ ./faster_rcnn_end2end.sh GPU_ID=0 VGG16 pascal_voc
$ ./faster_rcnn_end2end.sh GPU_ID=0 VGG16 pascal_voc /home/nvidia/TensorFlowTX2/Faster-RCNN_TF_changes/data/VOCdevkit16/VOCdevkit/VOC2007/ImageSets/Main
This was referenced on #3
@yfor1008 Thanks for your response What are the parameters to be changed in Faster-RCNN_TF/lib/fast_rcnn/config.py? I am using the same VOC dataset. I want to train it to 6 classes from 21.
I am currently facing this error when I run the command: ./experiments/scripts/faster_rcnn_end2end.sh GPU 0 VGG16 pascal_voc
File "./tools/train_net.py", line 81, in
KeyError: 'Unknown dataset: /home/nvidia/TensorFlowTX2/Faster-RCNN_TF_changes/data/VOCdevkit16/VOCdevkit/VOC2007/ImageSets/Main/voc_2007_trainval'
have you changed the dataset? I did it like this:
@yfor1008 Hi, Thankyou so much for your response. What are the changes to be made within the pascal_voc data folder ? Should I change all the folders such as annotations, imagesets,jpegimages,segmentation class and segmentation object? My ultimate intention is to make the model work only for bicycle,bus,cars,person and motorbikes Kindly help as I am completely new to this.
HI @Pratosha-29,
Since that folder contains images/annotations of all the categories. It will throw an error because train.txt contains all the names and you might have changed the number of classes in several py files.
Do one thing keep names of only the categories you want in train.txt, test.txt and val.txt
@artificial-mind , Thankyou so much for your response. Yes I will definitely try this and get back on it :)
@artificial-mind, I trained the VGGNet model with my own dataset but I can't find the .cpkt file after all the 70k iterations. Do we have to add certain line of code to generate that file?
Thank you in advance! :)
I want to ask you how to solve this problem: AssertionError: Path does not exist: /home/c303/student/yongzhang/Faster-RCNN_TF/data/VOCdevkit2007/VOC2007/JPEGImages/.jpg @gentlebreeze1
@280403328 In any of your text files there is a space left in between or at last. Kindly check that .This error is because of that only.
Thank you @artificial-mind .
I meet a problem:
Traceback (most recent call last):
File "./tools/train_net.py", line 83, in
How can I solve it?
Traceback (most recent call last):
File "./tools/train_net.py", line 83, in
How can I solve it?
Hi, I have don't have xml file for bounding box but now I have images with bounding boxes and they are png file. Can I use those png file as annotations? And which file do I need to change so that those png images with bounding boxes can be used as annotations?
I have changed the Annotation, Imagesets and JPEG dir into my dataset in VOC2007 and changed the classes and num_classes to 15. But it still don't work. Where else should I change?
Thanks.