Giter VIP home page Giter VIP logo

Comments (7)

machanic avatar machanic commented on July 27, 2024

I am a foreigner , I can't read japanese, I googled a lot of chainer example, But most of them is written in japanese, I want to know how to write a evaluator extension?

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

Well, I don't know much example other than ones in ChainerCV that modify Evaluator.

        observation = {}
        with reporter.report_scope(observation):
            reporter.report(report, target)
        return observation

This basically does observation.update(report).
By looking at the source code of the original Evaluator, you can find that our evaluator simply modified parts of it.

Actually, while trying to come up with an answer to your question, I realized that it can be simplified to return report!

As a side note, the context with reporter.report_score(observation) is useful when reporter.report is called inside of a function in the with block.
Here is an example.

import chainer
from chainer import reporter


def f():
    reporter.report({'a': 3})

if __name__ == '__main__':
    observation =  {}

    r = reporter.Reporter()

    with r:
        with reporter.report_scope(observation):
            f()

    print(observation)

EDIT:
Actually, I had to do reporter.report.
The with reporter.report_scope is needed to get the namespace of reported values (See Evaluator.__call__, where namespace is prepared).

from chainercv.

machanic avatar machanic commented on July 27, 2024

I just can't find where did it reported ?? in which log file path? I don't see any report F1 score or Accuracy in console print?

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

If you use LogReport in your train loop, the values will be printed to a file.
By default, the log file is result/log.
(https://github.com/chainer/chainercv/blob/master/examples/faster_rcnn/train.py#L100)

from chainercv.

machanic avatar machanic commented on July 27, 2024

@yuyu2172 but you also use PrintReport

trainer.extend(extensions.PrintReport(
  | ['iteration', 'epoch', 'elapsed_time', 'lr',
  | 'main/loss',
  | 'main/roi_loc_loss',
  | 'main/roi_cls_loss',
  | 'main/rpn_loc_loss',
  | 'main/rpn_cls_loss',
  | 'validation/main/map',
  | ]), trigger=print_interval)
``` 

Does this 2 line conflict with each other, 
I did not found any report log in my linux filesystem. I am try to find.

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

mAP gets recorded on the log file only when it gets evaluated.
You will find it in the log file at iteration 5000.

They don't conflict with each other.

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

If you have more question, please reopen.

from chainercv.

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.