-
Notifications
You must be signed in to change notification settings - Fork 938
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
Help needed!!! #359
Comments
I have the same problem. I get too many bounding boxes with the confidence level of 0.09 and no bounding boxes when I set it to 0.5. I hope someone can help. I am very lost. |
Hey! |
if you are still facing the problem please feel free to post it, i will try to solve it |
I had this problem before and I solved it. I haven't tried the 500 epochs. I'm seeing though that he did some changes to his code. In a commit on march, did you implement those changes there: https://github.com/IntranelConsulting/ssd_keras_tf2/commits/master/keras_loss_function |
Okay, I see, I don't have tensorflow-gpu, I'll get the one specific version you mentioned. Thank you for the help! I greatly appreciate it. Still curious about those commits he made but it looks like it's for the TF2.2.0rc. Thanks for the input Hiren. |
No i haven't seen those commits, but the version 0.9.0 works fine. |
Hi HIren, this is a nightmare for me: I keep get this warning WARNING:tensorflow:Gradients do not exist for variables ['conv1_1/bias:0', 'conv1_2/bias:0', 'conv2_1/bias:0', 'conv2_2/bias:0', 'conv3_1/bias:0', 'conv3_2/bias:0', 'conv3_3/bias:0', 'conv4_1/bias:0', 'conv4_2/bias:0', 'conv4_3/bias:0', 'conv5_1/bias:0', 'conv5_2/bias:0', 'conv5_3/bias:0', 'fc6/bias:0', 'fc7/bias:0', 'conv6_1/bias:0', 'conv6_2/bias:0', 'conv7_1/bias:0', 'conv7_2/bias:0', 'conv8_1/bias:0', 'conv8_2/bias:0', 'conv9_1/bias:0', 'conv4_3_norm/conv4_3_norm_gamma:0', 'conv9_2/bias:0', 'conv4_3_norm_mbox_conf/bias:0', 'fc7_mbox_conf/bias:0', 'conv6_2_mbox_conf/bias:0', 'conv7_2_mbox_conf/bias:0', 'conv8_2_mbox_conf/bias:0', 'conv9_2_mbox_conf/bias:0', 'conv4_3_norm_mbox_loc/bias:0', 'fc7_mbox_loc/bias:0', 'conv6_2_mbox_loc/bias:0', 'conv7_2_mbox_loc/bias:0', 'conv8_2_mbox_loc/bias:0', 'conv9_2_mbox_loc/bias:0'] when minimizing the loss. This suggests that no training is happening. I guess I will have to use the same versions you have. I get no predictions at all. Do you get this warning? |
@hiren-2911 I'm sorry I didn't reply earlier, I was busy with a lot of work. I just came back to this project today. My apologies. |
@Ezzysci Yeah i used to get those warnings earlier, but when i started using the versions which i mentioned, the warnings vanished. |
@hiren-2911 which tensorflow version are you using. I know you're using tensorflow-gpu 1.15 but which tensor flow are you using. I'm getting errors now after I downgraded the keras. |
I'm using python 3.8 and the latest tensorflow. I downgraded the keras version and it no longer works. It looks like it's not compatible with the latest tensorflow. |
@Ezzysci i have mentioned that use tensorflow-gpu==1.15 |
WARNING:tensorflow:Gradients do not exist for variables ['conv2d/kernel:0', 'conv2d/bias:0', 'conv2d_1/kernel:0', 'conv2d_1/bias:0', 'conv2d_2/kernel:0', 'conv2d_2/bias:0', 'conv2d_3/kernel:0', 'conv2d_3/bias:0', 'conv2d_4/kernel:0', 'conv2d_4/bias:0', 'conv2d_5/kernel:0', 'conv2d_5/bias:0', 'classes1/bias:0', 'classes2/bias:0', 'classes3/bias:0', 'classes4/bias:0', 'classes5/bias:0', 'classes6/bias:0', 'boxes1/bias:0', 'boxes2/bias:0', 'boxes3/bias:0', 'boxes4/bias:0', 'boxes5/bias:0', 'boxes6/bias:0'] when minimizing the loss. I still get this issue but im using tensorflow gpu 2.3. and keras 2.1 |
where did you get tensorflow-1.1.5 I cannnot use pip to install it. What is the error in the operation of tensors in the anchorboxes file, which code is it at? The 2.3 error has far as I have analyzed has to do with the eager execution and that the y_true is empty when first being computed in the model.fit. I'm still trying to solve it. |
Yeah i tried by disabling eager execution using tensorflow but now i get a different error and using tf 1-1.5 i get the error when doing a np.linalgspace operation in line no 198 and the input to the model.fit_generator im feeding 2 genereators where each have images as the X_label and y_true labels as a numpy array of the box and class coordinates |
u can get tensorflow 1.1.5 by just doing pip install tensorflow-gpu==1.1.5 |
Yes, I get the same error. If you do the hours of troubleshooting I did you get this: y_pred shape (None, 8732, 23) This is the feed. Slicing that y_true gives an error. My theory to fix this is to force it to be the same shape as y_pred but I don't know how to do it. I'm a noob. I haven't used 1.1.5 because hiren said it was 1.15 and I couldn't find it. This is how inexperienced I am. In either case, I wanted to port it to 2.0 so that I am on the latest and greatest. This was supposed to be one implementation and I was going to use another one with it. The project is pretty much falling apart, sadly. I'm still going to try to solve that indexing slicing issue by finding a way to set the y_true to the same shape as y_pred since this is the given for the function. |
Cannot convert a partially known TensorShape to a Tensor: This is what I get as the error when I try to either reshape or set the shape. It really is sad that there's little help on this. |
Oh thanks man even im a noob too |
The issue occurs in the loss function, this is the reason it's not getting trained. My interpretation is that it is not receiving any value for y_true; while in tensorflow 1.0 it would leave a placeholder for that tensor and then fill it with the values. I turned off eager execution and then I did a print function in the compute loss function. This gives me the input to the loss function. Eager Execution I think is used when fitting the model although it's turned off for tensorflow. |
yeah its turned on by default if u want u can turn it on |
Bro i fixed the error for some reason if i pass the images and bounding boxes as a numpy array instead of getting them using generators , i no longer get that gradient is zero warnings temp = next(train_gen) x_train = temp[0] x_val = temp1[0] history = ssd_model.fit(x_train,y_train, Tensor("IteratorGetNext:1", shape=(None, 68194, 14), dtype=float32) Since i passed just one batch and steps were given wrong it halted abrubtly but yeah it works now |
so now, you'll just use next without the indices. |
yeah but we just have to get the whole dataset using the next() function so i think we have to do that til lthe number of filenames is exceeded and then u feed the x and y train |
I finally found a best fix for the gradients being zero thing |
makes perfect sense. I tried to make it return a tensor before and it didn't work. I will try to turn it into a tuple, is there a straightforward way to do this? |
yeah |
U might get resource exhausted error so u just fiddle with the batch size but the gradient becoming zero wont happen |
@DoraemonSlayer69 Thank you for the input. I really appreciate the help. |
Cool man |
Did you fully port to tf2.0 in every file? https://github.com/IntranelConsulting/ssd_keras_tf2/commits/master |
Yeah in that i am using the loss function only so i updated only that |
The y_pred function will need to be ported to 2.0 as well. Can you show me what your code is for y_pred_decoded? |
sure its the file ssd_output_decoder |
Well you will get an empty array because the confidence level is 0.5 which quite high. After like six to 10 iterations you should be able to see it populate. I trained mine for 100 and started seeing it populate after about 15 iterations. |
Oh what i did was i trained the model for like 5 to 10 epochs and since loss wasnt changing much and on that model i call the predict function and get the ypred and then use it on the decode_detections_fast |
Train it for 100 epochs and 100 steps. |
Oh ok will do man |
I just want to give a big thanks to both of you (DoraemonSlayer69 and Ezzysci) because I was able to get it working thanks to your suggestions. |
Cool Man |
Thankyou @DoraemonSlayer69 @Ezzysci, I got it working because of you two! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @DoraemonSlayer69 and @Ezzysci , I am working on pedestrian detection using PennFudanPed dataset and having issues in the bounding box prediction which sometimes give negative coordinates. Btw, I made some changes in the network using MobileNetV2 as a base layer, no. of classes is 2 , aspect ratios are 0.5 and 1.0/3.0 across all the predcition layers. I even increased the value of alpha in the loss function to 4 to prioritize the localization loss, but it dosent seem to work. Can you guys help me with this? |
Please help.
The predictor is predicting too many bounding boxes all with same confidence level.
I really want to learn about this model and train it on my won custom dataset.
I read all the previous issue.
There were two similar issue regarding same problem on SSD7 model. But they havent been answered yet.
Please help me to understand where is the actual problem.
The text was updated successfully, but these errors were encountered: