Giter Club home page Giter Club logo

Comments (5)

glenn-jocher avatar glenn-jocher commented on May 18, 2024 1

Resolved with PR #45.

from yolov3.

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

Oh, thats an interesting comment @violet17. Yes at first this did not work, which is why I added line 23 before importing test.py, to prevent the first namespace from impacting the second.

yolov3/train.py

Lines 22 to 24 in 35e445c

# Import test.py to get mAP after each epoch
sys.argv[1:] = [] # delete any train.py command-line arguments before they reach test.py
import test # must follow sys.argv[1:] = []

I did not think about your solution, but yes this could work also. Which one is better from a 'best-practices' standpoint do you think?

from yolov3.

violet17 avatar violet17 commented on May 18, 2024

Thanks for your reply. Yes, the namespace in the test.py is used in your code.

from yolov3.

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

I was thinking about doing what you said, but I realied if we moved the parser arguments inside test.py into the if __name__ == '__main__': statement, we still need to tell it to use latest.pt instead of the default yolov3.pt. I do this now by redefining the the test.py -weights_path in line 205, but if the namespace were not defined yet I wouldn't be able to do this.

yolov3/train.py

Lines 204 to 206 in f05934f

# Calculate mAP
test.opt.weights_path = 'weights/latest.pt'
mAP, R, P = test.main(test.opt)

from yolov3.

violet17 avatar violet17 commented on May 18, 2024

So sorry about that. And thank you for the reply. I was confused about the scope of the namespace before. Now I realize that the first namespace could be used in train.py, and would be used in test.py. And the scope of the second namespace is test.py.

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.