DeepForest icon indicating copy to clipboard operation
DeepForest copied to clipboard

Multi Class Training not working.

Open Smart133594 opened this issue 3 years ago • 11 comments

RuntimeError: Error(s) in loading state_dict for RetinaNet: size mismatch for head.classification_head.cls_logits.weight: copying a param with shape torch.Size([9, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 256, 3, 3]). size mismatch for head.classification_head.cls_logits.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([18]).

When m.use_release()

If I use label_dict = {Tree:0}, this no happened. But If I use label_dict={"Dead":0,"Alive":1} This issue happened.

Smart133594 avatar Jul 29 '21 19:07 Smart133594

Solved

Smart133594 avatar Aug 02 '21 00:08 Smart133594

How did you solve this issue ? Kindly explain

Mashood3624 avatar Aug 12 '21 08:08 Mashood3624

I would love to know as well.

victoic avatar Apr 12 '22 18:04 victoic

@Mashood3624 or @victoic - can you provide a reproducible examples along with information on operating system, python version, etc. so that we can look into this. We are running multi-class models without issues so we need additional details to try to figure out the issues you are having. We are hoping to add better support for these models more broadly over the summer.

ethanwhite avatar Apr 13 '22 14:04 ethanwhite

@Smart133594 what was your solution?

bzsklvnt avatar Jul 12 '22 13:07 bzsklvnt

That was my code issue, all is fine.

Smart133594 avatar Jul 12 '22 14:07 Smart133594

I have this problem now, how did you solve it?

bzsklvnt avatar Jul 12 '22 15:07 bzsklvnt

I added some codes and that working now fully for the training.. All of trees detecting with tree names. What is your email?

Smart133594 avatar Jul 12 '22 15:07 Smart133594

No

On Tue, Jul 12, 2022 at 11:43 AM Bozsoki Levente @.***> wrote:

Hi Do you receive this email?

On Tue, Jul 12, 2022, 17:37 Smart Dev @.***> wrote:

I added some codes and that working now fully for the training.. All of trees detecting with tree names. What is your email?

— Reply to this email directly, view it on GitHub < https://github.com/weecology/DeepForest/issues/231#issuecomment-1181922617 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOJSPAR72LW2DREGQ24H2CTVTWGMRANCNFSM5BHB42JA

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/weecology/DeepForest/issues/231#issuecomment-1181928894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP5L7ZFINBTUZWSGN7C7T3VTWHCNANCNFSM5BHB42JA . You are receiving this because you were mentioned.Message ID: @.***>

Smart133594 avatar Jul 12 '22 15:07 Smart133594

Please contact me at @.*** !

Smart Dev @.***> ezt írta (időpont: 2022. júl. 12., K, 17:44):

No

On Tue, Jul 12, 2022 at 11:43 AM Bozsoki Levente @.***> wrote:

Hi Do you receive this email?

On Tue, Jul 12, 2022, 17:37 Smart Dev @.***> wrote:

I added some codes and that working now fully for the training.. All of trees detecting with tree names. What is your email?

— Reply to this email directly, view it on GitHub <

https://github.com/weecology/DeepForest/issues/231#issuecomment-1181922617

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOJSPAR72LW2DREGQ24H2CTVTWGMRANCNFSM5BHB42JA

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/weecology/DeepForest/issues/231#issuecomment-1181928894 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AQP5L7ZFINBTUZWSGN7C7T3VTWHCNANCNFSM5BHB42JA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/weecology/DeepForest/issues/231#issuecomment-1181930299, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJSPAXMHB2MHS6YRCS4ST3VTWHHBANCNFSM5BHB42JA . You are receiving this because you commented.Message ID: @.***>

bzsklvnt avatar Jul 13 '22 13:07 bzsklvnt

good morning. to the date, i have the same problem.

the model structure is the next.

image

the result of the model is the next.

image

EDGAR-BARAHONA avatar Aug 22 '22 22:08 EDGAR-BARAHONA

@bzsklvnt @ethanwhite

I am trying to test the multi class training and so far get no predictions using the provided testfile_multi.csv data. If I place "fast_dev_run" to False to train for more than one epoch, I get the following error:

"Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor"

Any insight as to how you solved this or what I'm doing incorrectly would be appreciated.

Screenshot from 2022-11-04 10-43-15

Screenshot from 2022-11-04 10-41-42

j-la-haye avatar Nov 04 '22 09:11 j-la-haye

Solved this error. Need to push the training to the GPU for second iteration. m.config['gpus'] = '1'

I still get terrible results on the provided test data and no predictions unless I use m.config["score_thresh"] = 0.01. Should this be the case (I understand its a tiny training set), but not sure if this is the result I should expect?

Thanks for any tips! SOAP_061

j-la-haye avatar Nov 04 '22 10:11 j-la-haye

@j-la-haye We haven't actively explored multi-class modeling with trees using DeepForest and definitely not with tiny training sets. In general that would be a difficult problem. My one suggestion is that it looks like you aren't using the existing backbone and regression head (the parts of the model that help construct the bounding boxes around trees) and I suspect that is why the crown detection results are so bad.

I'm closing this since we've let it sit for too long (sorry about that) and since we're not actively supporting multi-class work yet, but feel free to open a new issue if you have additional questions.

ethanwhite avatar Apr 22 '23 14:04 ethanwhite