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

RuntimeError: invalid argument 2: size '[16 x 3 x 15 x 13 x 13]' is invalid for input with 689520 elements at /pytorch/aten/src/TH/THStorage.cpp:84 #33

Closed
sporterman opened this issue Nov 6, 2018 · 6 comments

Comments

@sporterman
Copy link

models.py
p = p.view(bs, self.nA, self.bbox_attrs, nG, nG).permute(0, 1, 3, 4, 2).contiguous()
when i use this coda run my own dataset, it stoped here , erros was as follow:
image

@glenn-jocher
Copy link
Member

Please adjust the model accordingly for your dataset. The repository works for any object detection dataset, but you need to modify certain areas which are COCO-specific currently. The full list of directions is on this comment #6 (comment)

@sporterman
Copy link
Author

@glenn-jocher Thanks! I've trained 68 epoches , finally the precision was 1, but recall was 0, did you met this trouble? need some advice.

@Electronicshelf
Copy link

I had a similar problem, the best thing to do is to adjust the last constitutional layer before the [yolo] of the yolov3.cfg or the .cfg file that contains your model.
please Note that there are 3 [yolo] sections. so you have to change the filter size to macth your model. for one class, start from 18 then adjust accordingly...

@glenn-jocher
Copy link
Member

This tutorial explains how to train custom datasets, including updating the yolov3.cfg file for your class count.
https://github.com/ultralytics/yolov3/wiki/Example:-Train-Single-Class

@brlivsky
Copy link

brlivsky commented Mar 16, 2019

@glenn-jocher @Electronicshelf @sporterman

Hey guys!
I had the same error while running train.py.
image

This tutorial explains how to train custom datasets, including updating the yolov3.cfg file for your class count.
https://github.com/ultralytics/yolov3/wiki/Example:-Train-Single-Class

I'm training the model on my custom dataset. I did follow the below steps.

  1. Converted the dataset into darknet format
  2. Created train and test *.txt files
  3. Create a new *.names file
  4. Updated cfg/coco.data
  5. Updated *.cfg file

I have got a doubt whether I should modify the classes=80 in the 3 [yolo] sections in yolov3.cfg file. I've also read this comment, but I don't know how to implement steps 4, 5, 6 in the above comment.

UPDATE
I have modified classes=80 with 3(as I've 3 classes) and it has worked out for me!

@glenn-jocher
Copy link
Member

@Vysakhr great to hear its working for you now. We have updated the tutorials now to clearly state that the class counts need to updated in each YOLO layer in the *.cfg file, i.e. in your case from classes=80 to classes=3.

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

4 participants