Skip to content
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

Training on custom dataset (9 classes) #60

Open
dvlshah opened this issue Jan 3, 2020 · 3 comments
Open

Training on custom dataset (9 classes) #60

dvlshah opened this issue Jan 3, 2020 · 3 comments

Comments

@dvlshah
Copy link

dvlshah commented Jan 3, 2020

Hi,

I am facing issue in biFpn module while starting the training using pretrained d1.

File "train.py", line 238, in
train()
File "train.py", line 183, in train
classification, regression, anchors = model(images)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/deval/Projects/EfficientDet/EfficientDet.Pytorch/models/efficientdet.py", line 57, in forward
x = self.extract_feat(inputs)
File "/home/deval/Projects/EfficientDet/EfficientDet.Pytorch/models/efficientdet.py", line 90, in extract_feat
x = self.neck(x[-5:])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/deval/Projects/EfficientDet/EfficientDet.Pytorch/models/bifpn.py", line 105, in forward
laterals = bifpn_module(laterals)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/deval/Projects/EfficientDet/EfficientDet.Pytorch/models/bifpn.py", line 186, in forward
pathtd[i - 1] = (w1[0, i-1]*pathtd[i - 1] + w1[1, i-1]*F.interpolate(pathtd[i], scale_factor=3, mode='nearest'))/(w1[0, i-1] + w1[1, i-1] + self.eps)
RuntimeError: The size of tensor a (10) must match the size of tensor b (15) at non-singleton dimension 3

Input Size : (640,640)
Num Classes : 9

The data loaded is in the same format as the COCO.

Can you please help what am I doing wrong?

@sampathchanda
Copy link

Am also seeing the same issue. Were you able to resolve this issue?

@dvlshah
Copy link
Author

dvlshah commented Jan 6, 2020

I changed the scale_factor=3 to scale_factor=2. I was able to start the training. I don't know what it is used for.

@sampathchanda
Copy link

Not sure which version of the model file you are using, but I see that scale_factor is set as 2 already. From a quick look, scale_factor seems to be the upsampling factor for the feature maps.

I was trying to run the eval.py script. Seems like the augmentation is not set properly for the validation phase (in the version of the code I checked in). The issue I was facing is fixed in the commit: 8a9ec2f#diff-93102682735f61ab7d6b87aa1465caa4R38

eval.py script runs for me now. However, I see near zero performance with the provided weights. @dvlshah did you try running the eval.py script? If yes, what results are you seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants