Coder Social home page Coder Social logo

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 about yolov3 HOT 6 CLOSED

sporterman avatar sporterman commented on May 14, 2024
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

from yolov3.

Comments (6)

glenn-jocher avatar glenn-jocher commented on May 14, 2024

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)

from yolov3.

sporterman avatar sporterman commented on May 14, 2024

@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.

from yolov3.

Electronicshelf avatar Electronicshelf commented on May 14, 2024

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...

from yolov3.

glenn-jocher avatar glenn-jocher commented on May 14, 2024

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

from yolov3.

brlivsky avatar brlivsky commented on May 14, 2024

@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!

from yolov3.

glenn-jocher avatar glenn-jocher commented on May 14, 2024

@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.

from yolov3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.